aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/at/gv/egiz
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/at/gv/egiz')
-rw-r--r--src/test/java/at/gv/egiz/moazs/MoaSPSSSignatureVerifierTest.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/test/java/at/gv/egiz/moazs/MoaSPSSSignatureVerifierTest.java b/src/test/java/at/gv/egiz/moazs/MoaSPSSSignatureVerifierTest.java
index afa817f..7d3e9d1 100644
--- a/src/test/java/at/gv/egiz/moazs/MoaSPSSSignatureVerifierTest.java
+++ b/src/test/java/at/gv/egiz/moazs/MoaSPSSSignatureVerifierTest.java
@@ -5,8 +5,6 @@ import at.gv.egiz.moazs.verify.MoaSPSSSignatureVerifier;
import at.gv.egiz.moazs.verify.SignatureVerifier;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.TestConfiguration;
@@ -17,6 +15,7 @@ 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 MoaSPSSSignatureVerifierTest {
@@ -36,7 +35,6 @@ import java.nio.file.Files;
@Autowired
private SignatureVerifier verifier;
- //TODO make sure that testcase does not depend on runtime because it's certificate expires in 2023-09-27.
@Test
public void acceptValidSignedDeliveryResponse() throws IOException {
@@ -46,4 +44,13 @@ import java.nio.file.Files;
verifier.verify(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.verify(signature);
+ }
+
}