diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-05-27 09:46:36 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-05-27 10:28:56 +0200 |
commit | 695ab1f836160d40c4352a2c3127f4f687912817 (patch) | |
tree | cd23bf0e2f6430bd2f5caf40825705e3fe644f98 /src/test/java/at | |
parent | 0a316ada10bb88720dd15958168409fcb9fcf800 (diff) | |
download | moa-zs-695ab1f836160d40c4352a2c3127f4f687912817.tar.gz moa-zs-695ab1f836160d40c4352a2c3127f4f687912817.tar.bz2 moa-zs-695ab1f836160d40c4352a2c3127f4f687912817.zip |
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.
Diffstat (limited to 'src/test/java/at')
-rw-r--r-- | src/test/java/at/gv/egiz/moazs/MsgClientTest.java | 24 |
1 files changed, 13 insertions, 11 deletions
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 |