diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-02-11 15:05:27 -0500 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-02-11 15:05:43 -0500 |
commit | 673e7d4958c6f4a86a3997a9bcd778937b42499e (patch) | |
tree | 4d4d16ae4ff5fb487de8a6c5a8eaefeca5810b50 /bpmn/so-bpmn-tasks/src/test | |
parent | b80f29cbbeb5ec218b0278deef872f7b5350e292 (diff) |
Fix unmarshalling errors
add data assertion to network update unit test
Fix unmarshalling errors on updateNetworkResp and err
Change-Id: Iddc13514198b3c89718b1b953a06cec6db190269
Issue-ID: SO-1494
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java index 278afc733a..516c9480ad 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java @@ -20,12 +20,18 @@ package org.onap.so.bpmn.infrastructure.adapter.network.tasks; +import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; +import static org.junit.Assert.assertThat; + import java.io.IOException; +import java.util.HashMap; +import java.util.Map; import javax.xml.bind.JAXBException; import org.junit.Test; import org.onap.so.adapters.nwrest.CreateNetworkResponse; +import org.onap.so.adapters.nwrest.UpdateNetworkResponse; public class NetworkAdapterRestV1Test { @@ -36,4 +42,17 @@ public class NetworkAdapterRestV1Test { String returnedXml = response.toXmlString(); System.out.println(returnedXml); } + + @Test + public void testUnmarshalXmlUpdate() throws IOException, JAXBException { + UpdateNetworkResponse expectedResponse = new UpdateNetworkResponse(); + expectedResponse.setMessageId("ec100bcc-2659-4aa4-b4d8-3255715c2a51"); + expectedResponse.setNetworkId("80de31e3-cc78-4111-a9d3-5b92bf0a39eb"); + Map<String,String>subnetMap = new HashMap<String,String>(); + subnetMap.put("95cd8437-25f1-4238-8720-cbfe7fa81476", "d8d16606-5d01-4822-b160-9a0d257303e0"); + expectedResponse.setSubnetMap(subnetMap); + String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><updateNetworkResponse><messageId>ec100bcc-2659-4aa4-b4d8-3255715c2a51</messageId><networkId>80de31e3-cc78-4111-a9d3-5b92bf0a39eb</networkId><subnetMap><entry><key>95cd8437-25f1-4238-8720-cbfe7fa81476</key><value>d8d16606-5d01-4822-b160-9a0d257303e0</value></entry></subnetMap></updateNetworkResponse>"; + UpdateNetworkResponse response = (UpdateNetworkResponse) new NetworkAdapterRestV1().unmarshalXml(xml, UpdateNetworkResponse.class); + assertThat(expectedResponse, sameBeanAs(response)); + } } |