aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-05-08 16:17:48 +0200
committerChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-05-08 16:17:48 +0200
commit4aed369467b2c6486de69ac767475fd305e0e068 (patch)
tree57cfde8704e38462832068157535c947a92744c0
parent2f76971dbb71d3255ef19ea31cee13a27136c4d1 (diff)
downloadmoa-zs-4aed369467b2c6486de69ac767475fd305e0e068.tar.gz
moa-zs-4aed369467b2c6486de69ac767475fd305e0e068.tar.bz2
moa-zs-4aed369467b2c6486de69ac767475fd305e0e068.zip
Add "Reject Missing Sender" Test Case
-rw-r--r--src/test/java/at/gv/egiz/moazs/App2MzsServiceTest.java6
-rw-r--r--src/test/resources/at/gv/egiz/moazs/App2MzsServiceTest/missingSender.soap46
2 files changed, 52 insertions, 0 deletions
diff --git a/src/test/java/at/gv/egiz/moazs/App2MzsServiceTest.java b/src/test/java/at/gv/egiz/moazs/App2MzsServiceTest.java
index 8d7ee6f..cdb693a 100644
--- a/src/test/java/at/gv/egiz/moazs/App2MzsServiceTest.java
+++ b/src/test/java/at/gv/egiz/moazs/App2MzsServiceTest.java
@@ -68,6 +68,12 @@ public class App2MzsServiceTest {
}
@Test
+ public void rejectRequestWithoutSender() throws IOException, InterruptedException {
+ var response = sendDeliveryRequestFile("missingSender.soap");
+ assertEquals(500, response.statusCode());
+ }
+
+ @Test
public void rejectFormallyIncorrectDeliveryRequest() throws IOException, InterruptedException {
var response = sendDeliveryRequestFile("formallyIncorrectDeliveryRequest.soap");
assertEquals(500, response.statusCode());
diff --git a/src/test/resources/at/gv/egiz/moazs/App2MzsServiceTest/missingSender.soap b/src/test/resources/at/gv/egiz/moazs/App2MzsServiceTest/missingSender.soap
new file mode 100644
index 0000000..62cda34
--- /dev/null
+++ b/src/test/resources/at/gv/egiz/moazs/App2MzsServiceTest/missingSender.soap
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<soapenv:Envelope
+ xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:mzs="http://reference.e-government.gv.at/namespace/zustellung/mzs/app2mzs#"
+ xmlns:p="http://reference.e-government.gv.at/namespace/zustellung/mzs/persondata#"
+ xmlns:msg="http://reference.e-government.gv.at/namespace/zustellung/msg/phase2/20181206#"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <soapenv:Body>
+ <mzs:DeliveryRequest>
+ <mzs:Receiver>
+ <p:PhysicalPerson>
+ <p:Name>
+ <p:GivenName>Maxi</p:GivenName>
+ <p:FamilyName>Mustermann1</p:FamilyName>
+ </p:Name>
+ <p:DateOfBirth>1984-01-24</p:DateOfBirth>
+ </p:PhysicalPerson>
+ <p:PostalAddress>
+ <p:CountryCode>AT</p:CountryCode>
+ <p:PostalCode>1010</p:PostalCode>
+ <p:Municipality>Wien</p:Municipality>
+ <p:DeliveryAddress>
+ <p:StreetName>Muststrasse</p:StreetName>
+ <p:BuildingNumber>10</p:BuildingNumber>
+ </p:DeliveryAddress>
+ </p:PostalAddress>
+ </mzs:Receiver>
+ <msg:MetaData>
+ <msg:AppDeliveryID>valid-delivery-request-id</msg:AppDeliveryID>
+ <msg:Subject>WichtigeMitteilung</msg:Subject>
+ <msg:DeliveryQuality>RSa</msg:DeliveryQuality>
+ </msg:MetaData>
+ <mzs:Payload>
+ <mzs:DocumentReference>https://authority.gv.at/files/73bdf969781ba41fa07df1ff8439cf685c0db1c3</mzs:DocumentReference>
+ <mzs:FileName>brief.xml</mzs:FileName>
+ <mzs:MIMEType>text/xml</mzs:MIMEType>
+ <msg:CheckSum>
+ <msg:AlgorithmID>SHA1</msg:AlgorithmID>
+ <msg:Value>9b972c70fdaf5e1b26b3387c87b0ffb72e5940b6</msg:Value>
+ </msg:CheckSum>
+ <mzs:Size>123401</mzs:Size>
+ </mzs:Payload>
+ </mzs:DeliveryRequest>
+ </soapenv:Body>
+</soapenv:Envelope>