From 9dc0e72571a895e34a55c11d015c5d359b485aff Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Fri, 12 Jul 2019 08:31:42 +0200 Subject: Renamed and Simplified SignatureVerifier --- .../egiz/moazs/ITMoaSPSSSignatureVerifierTest.java | 55 ---------------------- .../at/gv/egiz/moazs/ITSignatureVerifierTest.java | 55 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 src/test/java/at/gv/egiz/moazs/ITMoaSPSSSignatureVerifierTest.java create mode 100644 src/test/java/at/gv/egiz/moazs/ITSignatureVerifierTest.java (limited to 'src/test/java') diff --git a/src/test/java/at/gv/egiz/moazs/ITMoaSPSSSignatureVerifierTest.java b/src/test/java/at/gv/egiz/moazs/ITMoaSPSSSignatureVerifierTest.java deleted file mode 100644 index 34f4e1b..0000000 --- a/src/test/java/at/gv/egiz/moazs/ITMoaSPSSSignatureVerifierTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package at.gv.egiz.moazs; - -import at.gv.egiz.eid.authhandler.modules.sigverify.moasig.api.ISignatureVerificationService; -import at.gv.egiz.moazs.backend.SignatureVerifier; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.TestConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.junit4.SpringRunner; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; - -//Note: Certificate that signed these delivery responses expires in 2023-09-27. -@RunWith(SpringRunner.class) -@SpringBootTest - public class ITMoaSPSSSignatureVerifierTest { - - private final String resourcesPath = "src/test/resources/at/gv/egiz/moazs/ITMoaSPSSSignatureVerifierTest/"; - - @TestConfiguration - public class Config{ - - @Bean - public SignatureVerifier verifier(@Autowired ISignatureVerificationService service){ - return new SignatureVerifier(service, "test-trust-profile", true); - } - - } - - @Autowired - private SignatureVerifier verifier; - - @Test - public void acceptValidSignedDeliveryResponse() throws IOException { - - var path = resourcesPath + "valid-signed-delivery-response.xml"; - var signature = Files.readAllBytes(new File(path).toPath()); - - verifier.accept(signature); - } - - @Test(expected = MoaZSException.class) - public void rejectInvalidSignedDeliveryResponse() throws IOException { - - var path = resourcesPath + "invalid-signed-delivery-response.xml"; - var signature = Files.readAllBytes(new File(path).toPath()); - - verifier.accept(signature); - } - -} diff --git a/src/test/java/at/gv/egiz/moazs/ITSignatureVerifierTest.java b/src/test/java/at/gv/egiz/moazs/ITSignatureVerifierTest.java new file mode 100644 index 0000000..e4dbec7 --- /dev/null +++ b/src/test/java/at/gv/egiz/moazs/ITSignatureVerifierTest.java @@ -0,0 +1,55 @@ +package at.gv.egiz.moazs; + +import at.gv.egiz.eid.authhandler.modules.sigverify.moasig.api.ISignatureVerificationService; +import at.gv.egiz.moazs.backend.SignatureVerifier; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.test.context.junit4.SpringRunner; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; + +//Note: Certificate that signed these delivery responses expires in 2023-09-27. +@RunWith(SpringRunner.class) +@SpringBootTest + public class ITSignatureVerifierTest { + + private final String resourcesPath = "src/test/resources/at/gv/egiz/moazs/ITSignatureVerifierTest/"; + + @TestConfiguration + public class Config{ + + @Bean + public SignatureVerifier verifier(@Autowired ISignatureVerificationService service){ + return new SignatureVerifier(service, "test-trust-profile", true); + } + + } + + @Autowired + private SignatureVerifier verifier; + + @Test + public void acceptValidSignedDeliveryResponse() throws IOException { + + var path = resourcesPath + "valid-signed-delivery-response.xml"; + var signature = Files.readAllBytes(new File(path).toPath()); + + verifier.accept(signature); + } + + @Test(expected = MoaZSException.class) + public void rejectInvalidSignedDeliveryResponse() throws IOException { + + var path = resourcesPath + "invalid-signed-delivery-response.xml"; + var signature = Files.readAllBytes(new File(path).toPath()); + + verifier.accept(signature); + } + +} -- cgit v1.2.3