diff options
author | Boslet, Cory <cory.boslet@att.com> | 2020-04-10 10:16:01 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2020-04-10 10:16:04 -0400 |
commit | e56dc1f432f47dcdcf03ee6f6e2b368bc2c0b789 (patch) | |
tree | c9f8d20c13c5299902e869d99002a0bd9fdd0c41 /adapters/mso-openstack-adapters/src/test | |
parent | 39315bf63770c66718e629d268c4f67183bcf17b (diff) |
Removed neutron mode code
Removed neutron mode code from the network adapter impl and updated
unit test
Updated variable names in network adapter impl
Issue-ID: SO-2803
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: Id1649333001ce5756dd5a0cdf47f953299307d27
Diffstat (limited to 'adapters/mso-openstack-adapters/src/test')
-rw-r--r-- | adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java | 150 |
1 files changed, 0 insertions, 150 deletions
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java index 284067a766..88c6992a0a 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java @@ -63,86 +63,6 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { public static final String NETWORK_NAME = "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0"; - - @Test - public void createNetworkByModelNameNeutronModeGetNetworkException() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenstackGet(wireMockServer, "/mockPublicUrl/v2.0/networks", HttpStatus.SC_INTERNAL_SERVER_ERROR); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_NEUTRON_Mode.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void createNetworkByModelNameNeutronModeCreateNetworkException() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork_404(wireMockServer, "dvspg-VCE_VPE-mtjnj40avbc"); - - mockOpenStackGetAllNeutronNetworks_404(wireMockServer); - - mockOpenstackPost(wireMockServer, "/mockPublicUrl/v2.0/networks", HttpStatus.SC_INTERNAL_SERVER_ERROR); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_NEUTRON_Mode.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void createNetworkByModelNameNeutronMode() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork_404(wireMockServer, "dvspg-VCE_VPE-mtjnj40avbc"); - - mockOpenStackGetAllNeutronNetworks_404(wireMockServer); - - mockOpenStackPostNeutronNetwork_200(wireMockServer, "OpenstackCreateNeutronNetworkResponse.json"); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_NEUTRON_Mode.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void createNetworkByModelNameAlreadyExistNeutronMode() throws IOException { - - mockUpdateRequestDb(wireMockServer, "9733c8d1-2668-4e5f-8b51-2cacc9b662c0"); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetAllNeutronNetworks_200(wireMockServer, "OpenstackGetNeutronNetworks.json"); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_NEUTRON_Mode.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void createNetworkByModelNameAlreadyExistNeutronModeFailIfExistTrue() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetAllNeutronNetworks_200(wireMockServer, "OpenstackGetNeutronNetworks.json"); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_NEUTRON_Mode_Fail_If_Exist_True.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - @Test public void createNetworkByModelNameHeatMode() throws IOException { @@ -300,61 +220,6 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); } - - @Test - public void deleteNetworkNeureonMode() throws IOException { - - mockUpdateRequestDb(wireMockServer, "5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork(wireMockServer, "GetNeutronNetwork.json", NETWORK_ID, HttpStatus.SC_OK); - - mockOpenStackDeleteNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_OK); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/DeleteNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), - uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void deleteNetworkNeutronModeDeleteStackException() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork(wireMockServer, "GetNeutronNetwork.json", NETWORK_ID, HttpStatus.SC_OK); - - mockOpenStackDeleteNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR); - - // mockOpenStackGetStackCreated_200("OpenstackResponse_Stack_Created.json", NETWORK_ID); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/DeleteNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), - uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void updateNetworkNeutronModeSuccess() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork(wireMockServer, "GetNeutronNetwork.json", NETWORK_ID, HttpStatus.SC_OK); - mockOpenStackPutNeutronNetwork_200(wireMockServer, "OpenstackCreateNeutronNetworkResponse.json", NETWORK_ID); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/UpdateNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), - uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - @Test public void updateNetworkNeutronUpdateException() throws IOException { @@ -487,21 +352,6 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); } - @Test - public void queryNetworkNeutronModeException() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/QueryNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), uri, - HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - public ResponseEntity<String> sendXMLRequest(String requestJson, String uriPath, HttpMethod reqMethod) { headers.set("Accept", MediaType.APPLICATION_XML); headers.set("Content-Type", MediaType.APPLICATION_XML); |