summaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src/test/java/org
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-09-17 11:14:35 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-09-17 12:01:30 -0400
commit08c27a288e961c1ffd4151384ef0f609bb855e10 (patch)
tree5a139d4624226dcf543e14afeef284dec352be70 /adapters/mso-openstack-adapters/src/test/java/org
parent184e1ed3e83effc39b6f7f92c9f4b9d874c4cfe7 (diff)
more stability fixes
Remove conditional to not check VNF topology add empty string verification for serviceName field Add junits for CNRCR and NtwkAdptr changes. Add search in new CollNtwkResCust tbl to get NtwkResource. - Updated test data files to include 'pre-load' flag in both VfModuleOperation and NetworkOperation json test data files. - MSO to not to send <preload>boolean</from-preload> to SDNC in network-topology-opertion and vf-module-topology-operation. Updated GeneralTopologyObjectMapper to set 'from-preload' to null so that elements with Nulls are not sent to SDNC. Updated buildNetworkInformation() and buildVfModuleInformation() methods. update flow stats to not cause bpmn flow to crash Fix headers so SDNC does not return XML Add implementation of deleteVolumeGroupResponse parsing; fix JUnits that worked by accident. Change-Id: Ia96d552d731e112505fcf739029a6fd4d0134546 Issue-ID: SO-1061 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'adapters/mso-openstack-adapters/src/test/java/org')
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java31
1 files changed, 30 insertions, 1 deletions
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java
index 2a4564bcb2..6123415b41 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java
@@ -142,7 +142,7 @@ public class NetworkAdapterRestTest extends BaseRestTestUtils {
ResponseEntity<CreateNetworkResponse> response = restTemplate.exchange(
createURLWithPort("/services/rest/v1/networks"), HttpMethod.POST, entity, CreateNetworkResponse.class);
-
+
CreateNetworkResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue(
new File("src/test/resources/__files/CreateNetworkResponse2.json"), CreateNetworkResponse.class);
@@ -150,6 +150,8 @@ public class NetworkAdapterRestTest extends BaseRestTestUtils {
assertThat(response.getBody(), sameBeanAs(expectedResponse));
}
+
+
@Test
public void testDeleteNetwork() throws IOException{
@@ -267,6 +269,33 @@ public class NetworkAdapterRestTest extends BaseRestTestUtils {
assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
}
+ @Test
+ public void testCreateNetworkCNRC_JSON() throws JSONException, JsonParseException, JsonMappingException, IOException {
+
+ mockOpenStackResponseAccess(wireMockPort);
+
+ mockOpenStackPostPublicUrlWithBodyFile_200();
+
+ mockOpenStackGetStackCreatedAppC_200();
+
+ mockOpenStackGetStackAppC_404();
+
+ headers.add("Content-Type", MediaType.APPLICATION_JSON);
+ headers.add("Accept", MediaType.APPLICATION_JSON);
+
+ String request = readJsonFileAsString("src/test/resources/CreateNetwork3.json");
+ HttpEntity<String> entity = new HttpEntity<String>(request, headers);
+
+ ResponseEntity<CreateNetworkResponse> response = restTemplate.exchange(
+ createURLWithPort("/services/rest/v1/networks"), HttpMethod.POST, entity, CreateNetworkResponse.class);
+
+ CreateNetworkResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue(
+ new File("src/test/resources/__files/CreateNetworkResponse3.json"), CreateNetworkResponse.class);
+
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value());
+ assertThat(response.getBody(), sameBeanAs(expectedResponse));
+ }
+
@Override
protected String readJsonFileAsString(String fileLocation) throws JsonParseException, JsonMappingException, IOException{
return new String(Files.readAllBytes(Paths.get(fileLocation)));