From 63baa41b1ea5ce6f2f9a1513522f7ad54ed0ceab Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Wed, 31 Jul 2019 16:29:19 +0200 Subject: Add Testcase For "Verify Signed Notification" --- .../at/gv/egiz/moazs/ITSignatureVerifierTest.java | 10 +++ .../valid-signed-notification.xml | 91 ++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 src/test/resources/at/gv/egiz/moazs/ITSignatureVerifierTest/valid-signed-notification.xml (limited to 'src') diff --git a/src/test/java/at/gv/egiz/moazs/ITSignatureVerifierTest.java b/src/test/java/at/gv/egiz/moazs/ITSignatureVerifierTest.java index e4dbec7..592b108 100644 --- a/src/test/java/at/gv/egiz/moazs/ITSignatureVerifierTest.java +++ b/src/test/java/at/gv/egiz/moazs/ITSignatureVerifierTest.java @@ -43,6 +43,16 @@ import java.nio.file.Files; verifier.accept(signature); } + @Test + public void acceptValidDeliveryNotification() throws IOException { + + var path = resourcesPath + "valid-signed-notification.xml"; + var signature = Files.readAllBytes(new File(path).toPath()); + + verifier.accept(signature); + } + + @Test(expected = MoaZSException.class) public void rejectInvalidSignedDeliveryResponse() throws IOException { diff --git a/src/test/resources/at/gv/egiz/moazs/ITSignatureVerifierTest/valid-signed-notification.xml b/src/test/resources/at/gv/egiz/moazs/ITSignatureVerifierTest/valid-signed-notification.xml new file mode 100644 index 0000000..7dfd2ee --- /dev/null +++ b/src/test/resources/at/gv/egiz/moazs/ITSignatureVerifierTest/valid-signed-notification.xml @@ -0,0 +1,91 @@ + + + https://localhost/example-delivery-system + 12345 + 678910 + + + Musterbehörde + + + AT + 1234 + Graz + + Musterstraße + 1 + b2 + + + + max.mustermann@musterbehoerde.gv.at + + + + + + Maxi + Mustermann1 + + 1984-01-24-02:00 + + + 1010 + Wien + + Muststrasse + 10 + + + + + + electronic + 2002-05-30T09:00:00 + + + 2002-05-30T09:00:00 + + + + 1234 + + 1234 + + + + 100 + + + + + kh0DDpXv4nh2gqK3lVle+3O/Oz4nSB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