From 626b8f2399043c35d3bcb86e1d1c6142e2e0e327 Mon Sep 17 00:00:00 2001 From: "Smokowski, Steven" Date: Tue, 21 May 2019 11:58:01 -0400 Subject: fix keypair conflict issue in openstack adapter Fix wiremock stubs to return proper data and url Fix copyright header issue on unit test file Fix keypair issue, clean up unit tests and logging Fix issues found in unit testing, update data Fix broken Unit tests that used invalid data Continue Refactor to support keypair failure scenario Update logic for when to auto delete a stuck keypair Change-Id: Ice5256cf0381a3b46d1c442907c0f321a1c0d006 Issue-ID: SO-1897 Signed-off-by: Benjamin, Max (mb388a) --- .../network/MSONetworkAdapterImplTest.java | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'adapters/mso-openstack-adapters/src/test/java') 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 4dcb7c8710..add1918748 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 @@ -20,18 +20,6 @@ package org.onap.so.adapters.network; -import org.apache.http.HttpStatus; -import org.junit.Test; -import org.onap.so.adapters.vnf.BaseRestTestUtils; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import org.springframework.web.util.UriComponentsBuilder; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; import static org.junit.Assert.assertEquals; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteNeutronNetwork; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteStack_200; @@ -52,6 +40,18 @@ import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutStack; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenstackGet; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenstackPost; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.http.HttpStatus; +import org.junit.Test; +import org.onap.so.adapters.vnf.BaseRestTestUtils; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.web.util.UriComponentsBuilder; public class MSONetworkAdapterImplTest extends BaseRestTestUtils { @@ -142,12 +142,12 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStack_404(wireMockServer, "dvspg-VCE_VPE-mtjnj40avbc"); + mockOpenStackGetStack_404(wireMockServer, "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId"); mockOpenStackPostStack_200(wireMockServer, "OpenstackResponse_Stack.json"); mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", - "dvspg-VCE_VPE-mtjnj40avbc/stackId"); + "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId"); String uri = "/services/NetworkAdapter"; headers.set("X-ECOMP-RequestID", "123456789456127"); @@ -163,7 +163,7 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { mockOpenStackPostStack_200(wireMockServer, "OpenstackResponse_Stack.json"); mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", - "dvspg-VCE_VPE-mtjnj40avbc"); + "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId"); String uri = "/services/NetworkAdapter"; headers.set("X-ECOMP-RequestID", "123456789456127"); -- cgit 1.2.3-korg