From 695ab1f836160d40c4352a2c3127f4f687912817 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Mon, 27 May 2019 09:46:36 +0200 Subject: Intercept Incoming DeliveryRequestStatus and Store as byte[] - Add egovutils dependency (Reason: Need DomUtils to serialize / unserialize Soap Message via DOMParser) - Add Incerceptor to MsgClient / -Factory that stores the message content byte-by-byte in the DeliveryRepository. The format is required for successfully validating a DeliveryRequestStatus. - Add SoapUtils, which interacts with byte[] Soap message. - Add CXFMessageUtils, which interacts with CXF Messages from interceptor chains. - Refactor xsd namespaces: Move them out from the PrefixMapper and into a dedicated class. --- src/test/java/at/gv/egiz/moazs/MsgClientTest.java | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/test/java/at/gv') diff --git a/src/test/java/at/gv/egiz/moazs/MsgClientTest.java b/src/test/java/at/gv/egiz/moazs/MsgClientTest.java index 9d79435..1822ff5 100644 --- a/src/test/java/at/gv/egiz/moazs/MsgClientTest.java +++ b/src/test/java/at/gv/egiz/moazs/MsgClientTest.java @@ -6,7 +6,6 @@ import at.gv.egiz.moazs.scheme.Marshaller; import at.gv.zustellung.app2mzs.xsd.ConfigType; import at.gv.zustellung.msg.xsd.DeliveryRequestType; import at.gv.zustellung.msg.xsd.ObjectFactory; -import org.junit.Test; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -23,8 +22,8 @@ import static at.gv.zustellung.app2mzs.xsd.ConfigType.configTypeBuilder; import static at.gv.zustellung.app2mzs.xsd.ServerType.serverTypeBuilder; -//@RunWith(SpringRunner.class) -//@SpringBootTest +// @RunWith(SpringRunner.class) +// @SpringBootTest public class MsgClientTest { private final static Logger logger = LoggerFactory.getLogger(MsgClient.class); @@ -34,27 +33,30 @@ public class MsgClientTest { private final String basePath = "src/test/resources/at/gv/egiz/moazs/MsgClientTest/"; - private MsgClientFactory factory = new MsgClientFactory(); - @Autowired private Marshaller msgMarshaller; + @Autowired + private MsgClientFactory factory; + private static final ObjectFactory OF = new ObjectFactory(); // this test requires that a zusemsg service runs under httpServiceUri! - - //tmp disabled. todo: set up integration tests - //@Test + // tmp disabled. todo: set up integration tests + // @Test public void sendValidMessage() throws IOException { var request = loadFromFile("validDeliveryRequest.xml"); var config = generateConfig(httpServiceUri); var client = factory.create(request, config); - var status = client.send(); - - logger.info("status: " + msgMarshaller.marshallXml(OF.createDeliveryRequestStatus(status))); + try{ + var status = client.send(); + logger.info("status: " + msgMarshaller.marshallXml(OF.createDeliveryResponse(status))); + } catch (Exception ex) { + System.out.println(ex.getMessage()); + } } //@Test -- cgit v1.2.3