Skip to content
Snippets Groups Projects
Commit 23d18ec8 authored by Jan Zickermann's avatar Jan Zickermann
Browse files

KOP-3126 Use constant example

parent 49b2044a
No related branches found
No related tags found
No related merge requests found
Pipeline #2287 failed
...@@ -80,8 +80,8 @@ class XtaSchemaValidationITCase { ...@@ -80,8 +80,8 @@ class XtaSchemaValidationITCase {
void shouldThrowUnmarshallExceptionOnBadResponse() { void shouldThrowUnmarshallExceptionOnBadResponse() {
wireMockServer.stubFor(post(XTA_MOCK_SERVER_URL_PATH + "msgBoxPort.svc") wireMockServer.stubFor(post(XTA_MOCK_SERVER_URL_PATH + "msgBoxPort.svc")
.willReturn( .willReturn(
XtaMockServerResponseTestFactory.createGetMessageResponse( XtaMockServerResponseTestFactory.createConstantGetMessageResponse(
"2f45a9e9-ed40-4e14-a082-de0d063e56e7_Geschaeftsgang.Geschaeftsgang.0201.zip"))); "84d0edd7-709b-4a7b-9aac-b3ee82041ef0_Geschaeftsgang.Geschaeftsgang.0201.zip")));
var message = xtaService.getMessage("urn:de:xta:messageid:dataport_xta_210:db6ad282-c510-4154-a167-daaa8b9f345a", XtaIdentifier.builder() var message = xtaService.getMessage("urn:de:xta:messageid:dataport_xta_210:db6ad282-c510-4154-a167-daaa8b9f345a", XtaIdentifier.builder()
.value("afmsh:ozg-cloud-stage-Utopia") .value("afmsh:ozg-cloud-stage-Utopia")
......
...@@ -107,6 +107,31 @@ public class XtaMockServerResponseTestFactory { ...@@ -107,6 +107,31 @@ public class XtaMockServerResponseTestFactory {
.withHeader("Content-Type", MULTIPART_RELATED_CONTENT_TYPE) .withHeader("Content-Type", MULTIPART_RELATED_CONTENT_TYPE)
.withBody(body); .withBody(body);
} }
public static ResponseDefinitionBuilder createConstantGetMessageResponse(String xtaAttachmentFileName) {
var envelopeXMLString = TestUtils.loadTextFile("mock-responses/getMessage/stage-example/example2/example.xml");
var body = combineParts(
createPart(
ENVELOPE_HEADERS,
envelopeXMLString
),
createPart(
Map.of(
"Content-ID", "<http://tempuri.org/1/638791906228054916>",
"Content-Transfer-Encoding", "base64",
"Content-Type", "application/octet-stream"
),
loadFileAsBase64(
getAttachmentFilePath(xtaAttachmentFileName)
)
)
);
return ok()
.withHeader("Content-Type", MULTIPART_RELATED_CONTENT_TYPE)
.withBody(body);
}
private static String createMessageMetadataXml(String xtaAttachmentFileName) { private static String createMessageMetadataXml(String xtaAttachmentFileName) {
return TestUtils.loadTextFile( return TestUtils.loadTextFile(
......
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://www.osci.eu/ws/2008/05/transport/urn/messageTypes/MsgBoxFetchRequest</a:Action><h:MsgBoxResponse MsgBoxRequestID="urn:de:xta:messageid:dataport_xta_210:b32f749e-8188-49a9-add4-3e0f3c309f78" xmlns:h="http://www.osci.eu/ws/2008/05/transport" xmlns="http://www.osci.eu/ws/2008/05/transport" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ItemsPending>0</ItemsPending></h:MsgBoxResponse><h:MessageMetaData xmlns:h="http://www.osci.eu/ws/2014/10/transport" xmlns="http://www.osci.eu/ws/2014/10/transport"><DeliveryAttributes><Origin>2025-04-02T10:41:30.488</Origin><Delivery>2025-04-02T10:41:33.17</Delivery></DeliveryAttributes><Originators><Author><Identifier type="xoev">afmsh:WebMethod_Online-Dienste</Identifier></Author></Originators><Destinations><Reader><Identifier type="xoev">afmsh:ozg-cloud-stage-Utopia</Identifier></Reader></Destinations><MsgIdentification><MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:de:xta:messageid:dataport_xta_210:b32f749e-8188-49a9-add4-3e0f3c309f78</MessageID></MsgIdentification><Qualifier><Service>urn:xdomea:AFM</Service><BusinessScenario><Defined listURI="urn:de:dataport:codeliste:business.scenario" listVersionID="1"><code xmlns="">AFM_DATA</code></Defined></BusinessScenario><MessageType listURI="urn:de:payloadSchema:elementName" listVersionID="1.0" payloadSchema="http://www.xdomea.de/V2.0.1"><code xmlns="">Geschaeftsgang.Geschaeftsgang.0201</code></MessageType></Qualifier><MsgSize>57828</MsgSize></h:MessageMetaData><a:RelatesTo>urn:uuid:f3942209-ef9c-4371-9a12-df4fc4b846a8</a:RelatesTo></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GenericContentContainer xmlns="http://xoev.de/transport/xta/211"><ContentContainer><Message contentType="application/zip" filename="84d0edd7-709b-4a7b-9aac-b3ee82041ef0_Geschaeftsgang.Geschaeftsgang.0201.zip" id="84d0edd7-709b-4a7b-9aac-b3ee82041ef0" size="57828"><xop:Include href="cid:http://tempuri.org/1/638791906228054916" xmlns:xop="http://www.w3.org/2004/08/xop/include"/></Message></ContentContainer></GenericContentContainer></s:Body></s:Envelope>
<s:Header> \ No newline at end of file
<a:Action s:mustUnderstand="1">http://www.osci.eu/ws/2008/05/transport/urn/messageTypes/MsgBoxFetchRequest
</a:Action>
<h:MsgBoxResponse MsgBoxRequestID="urn:de:xta:messageid:dataport_xta_210:0b2d4796-7f31-40c3-b834-7f7c66c042c9"
xmlns:h="http://www.osci.eu/ws/2008/05/transport" xmlns="http://www.osci.eu/ws/2008/05/transport"
>
<ItemsPending>0</ItemsPending>
</h:MsgBoxResponse>
<h:MessageMetaData xmlns:h="http://www.osci.eu/ws/2014/10/transport"
xmlns="http://www.osci.eu/ws/2014/10/transport">
<DeliveryAttributes>
<Origin>2025-04-02T10:49:30.324</Origin>
<Delivery>2025-04-02T10:49:32.893</Delivery>
</DeliveryAttributes>
<Originators>
<Author>
<Identifier type="xoev">afmsh:WebMethod_Online-Dienste</Identifier>
</Author>
</Originators>
<Destinations>
<Reader>
<Identifier type="xoev">afmsh:ozg-cloud-stage-Utopia</Identifier>
</Reader>
</Destinations>
<MsgIdentification>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">
urn:de:xta:messageid:dataport_xta_210:0b2d4796-7f31-40c3-b834-7f7c66c042c9
</MessageID>
</MsgIdentification>
<Qualifier>
<Service>urn:xdomea:AFM</Service>
<BusinessScenario>
<Defined listURI="urn:de:dataport:codeliste:business.scenario" listVersionID="1">
<code xmlns="">AFM_DATA</code>
</Defined>
</BusinessScenario>
<MessageType listURI="urn:de:payloadSchema:elementName" listVersionID="1.0"
payloadSchema="http://www.xdomea.de/V2.0.1">
<code xmlns="">Geschaeftsgang.Geschaeftsgang.0201</code>
</MessageType>
</Qualifier>
<MsgSize>57890</MsgSize>
</h:MessageMetaData>
<a:RelatesTo>urn:uuid:0cb6ed55-8ac9-492a-9e76-6235e41729ea</a:RelatesTo>
</s:Header>
<s:Body>
<GenericContentContainer xmlns="http://xoev.de/transport/xta/211">
<ContentContainer>
<Message contentType="application/zip"
filename="1088975e-5892-474e-a0e9-d3cef8ee61db_Geschaeftsgang.Geschaeftsgang.0201.zip"
id="1088975e-5892-474e-a0e9-d3cef8ee61db" size="57890">
<xop:Include href="cid:http://tempuri.org/1/638791906226975019"
xmlns:xop="http://www.w3.org/2004/08/xop/include" />
</Message>
</ContentContainer>
</GenericContentContainer>
</s:Body>
</s:Envelope>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment