diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-01-20 16:10:18 -0500 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-01-21 14:40:34 -0500 |
commit | 63bee11f255fcd2cc39a3d87c208aa6e517a8f85 (patch) | |
tree | d7b13599feffd4cc2cfd9836e83385c32869b448 /mso-api-handlers/mso-api-handler-infra/src/test/java | |
parent | 9756b9992858a5f513953f1d16b4d9b396a8397a (diff) |
Bug fixes from AT&T January 20th
sorted vfmodules by base last for negative action reqs
store Response in execution as String on network delete
added functionality to skip rollback based on flag # Conflicts: #
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflo
w/tasks/WorkflowAction.java
require XML in the header for delete network request
Update APP-C LCM Client library version to 1.7.0.
replaced wiremock style test with mockito test
Handle AAIClient Exps in CreateCustomerV1 getServiceInstance()
changed default status code to be configurable
Replace vnfType by nfRole in the healthcheck request to SDNO.
updated error messages in sdnc handler and flow status
updated flow status message on completion of flow
Send GenericVnf object for AAI VNF update for vnf-api updates
Add a JUnit test file for SDNOValidatorImpl.java
Set nodeType on the inner SDNO request as per update from SDNO.
updated rollbackToAssigned logic to remove unassign flows
updated sdnc handler error message for client error
added exception handling for httpclienterror in sdnc
out map workflow exception so error is reported
throws sdnc error message on bad response from sdnc
add catalog entries for TRANSPORT service delete flows
change script number that was duplicate
add find method to NorthBoundRequestRepository
include serviceType in hash code
use asterisk for all non-TRANSPORT flow db entries
alacart true, rm not needed transport srvc model steps
correct insert query syntax for orchestration_flow
support serviceType (TRANSPORT) process flow
fix SDNCAdapterException causing no callback to bpmn
use JsonAlias for alternate case when deserializing
GRM client will accept both "serviceEndPointList" and
"ServiceEndPointList" root node in the JSON response.
AAIRestClient now uses getSystemName in headers
finishtime should not be returned in requeststatus
Change-Id: I81a185252b057020f7f36f125c85c3357756da88
Issue-ID: SO-1403
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/java')
2 files changed, 47 insertions, 8 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java index 4a6a59bebb..28797d247b 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java @@ -31,6 +31,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static com.shazam.shazamcrest.MatcherAssert.assertThat; import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import java.io.File; import java.io.IOException; @@ -118,13 +119,14 @@ public class OrchestrationRequestsTest extends BaseTest { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.requestStatus.finishTime") + sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.finishTime") .ignoring("request.requestStatus.timeStamp")); assertEquals("application/json", response.getHeaders().get(HttpHeaders.CONTENT_TYPE).get(0)); assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0)); assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0)); assertEquals("7.0.0", response.getHeaders().get("X-LatestVersion").get(0)); assertEquals("00032ab7-na18-42e5-965d-8ea592502018", response.getHeaders().get("X-TransactionID").get(0)); + assertNotNull(response.getBody().getRequest().getFinishTime()); } @Test @@ -149,8 +151,7 @@ public class OrchestrationRequestsTest extends BaseTest { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("request.startTime") - .ignoring("request.requestStatus.finishTime") + sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.finishTime") .ignoring("request.requestStatus.timeStamp")); } @@ -177,8 +178,7 @@ public class OrchestrationRequestsTest extends BaseTest { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("request.startTime") - .ignoring("request.requestStatus.finishTime") + sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.finishTime") .ignoring("request.requestStatus.timeStamp")); assertEquals("application/json", response.getHeaders().get(HttpHeaders.CONTENT_TYPE).get(0)); assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0)); @@ -227,8 +227,7 @@ public class OrchestrationRequestsTest extends BaseTest { ResponseEntity<GetOrchestrationListResponse> response = restTemplate.exchange(builder.toUriString(), HttpMethod.GET, entity, GetOrchestrationListResponse.class); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("requestList.request.startTime") - .ignoring("requestList.request.requestStatus.finishTime") + sameBeanAs(testResponse).ignoring("requestList.request.startTime").ignoring("requestList.request.finishTime") .ignoring("requestList.request.requestStatus.timeStamp")); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertEquals(requests.size(), response.getBody().getRequestList().size()); @@ -482,4 +481,4 @@ public class OrchestrationRequestsTest extends BaseTest { .withBody(new String(Files.readAllBytes(Paths.get("src/test/resources/OrchestrationRequest/getRequestDetailsFilter.json")))) .withStatus(HttpStatus.SC_OK))); } -}
\ No newline at end of file +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java index 809e39c772..100bc82f7a 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java @@ -52,6 +52,7 @@ public class CreateVnfOperationalEnvironmentTest extends BaseTest{ private CloudOrchestrationRequest request; private ServiceEndPointList serviceEndpoints; + private ServiceEndPointList serviceEndpoints2; @Autowired private CreateVnfOperationalEnvironment createVnfOpEnv; @@ -63,6 +64,8 @@ public class CreateVnfOperationalEnvironmentTest extends BaseTest{ request = mapper.readValue(jsonRequest, CloudOrchestrationRequest.class); String jsonServiceEndpoints = getFileContentsAsString("__files/vnfoperenv/endpoints.json"); serviceEndpoints = mapper.readValue(jsonServiceEndpoints, ServiceEndPointList.class); + String jsonServiceEndpoints2 = getFileContentsAsString("__files/vnfoperenv/endpoints2.json"); + serviceEndpoints2 = mapper.readValue(jsonServiceEndpoints2, ServiceEndPointList.class); } @Test public void testGetEcompManagingEnvironmentId() throws Exception { @@ -83,6 +86,13 @@ public class CreateVnfOperationalEnvironmentTest extends BaseTest{ assertEquals("DEV", createVnfOpEnv.getEnvironmentName(props)); } + @Test + public void testGetEnvironmentNameEndpointListBeginWithUpperCase() { + createVnfOpEnv.setRequest(request); + List<Property> props = serviceEndpoints2.getServiceEndPointList().get(0).getProperties(); + assertEquals("DEV", createVnfOpEnv.getEnvironmentName(props)); + } + @Test public void testBuildServiceNameForVnf() throws Exception { createVnfOpEnv.setRequest(request); @@ -141,4 +151,34 @@ public class CreateVnfOperationalEnvironmentTest extends BaseTest{ .withStatus(HttpStatus.SC_OK))); createVnfOpEnv.execute(requestId, request); } + + @Test + public void testExecuteEndpointsListBeginWithUppercase() throws ApiException, JsonProcessingException { + stubFor(get(urlPathMatching("/aai/" + AAIVersion.LATEST + "/cloud-infrastructure/operational-environments/.*")) + .willReturn(aResponse().withHeader("Content-Type", "application/json").withBodyFile("vnfoperenv/ecompOperationalEnvironment.json").withStatus(HttpStatus.SC_ACCEPTED))); + stubFor(post(urlPathMatching("/GRMLWPService/v1/serviceEndPoint/findRunning")) + .willReturn(aResponse().withHeader("Content-Type", "application/json").withBodyFile("vnfoperenv/endpoints2.json").withStatus(HttpStatus.SC_ACCEPTED))); + stubFor(post(urlPathMatching("/GRMLWPService/v1/serviceEndPoint/add")) + .willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_ACCEPTED))); + stubFor(put(urlPathMatching("/aai/" + AAIVersion.LATEST + "/cloud-infrastructure/operational-environments/.*")) + .willReturn(aResponse().withHeader("Content-Type", "application/json").withBodyFile("vnfoperenv/ecompOperationalEnvironment.json").withStatus(HttpStatus.SC_ACCEPTED))); + String requestId = UUID.randomUUID().toString(); + InfraActiveRequests iar = new InfraActiveRequests(); + iar.setRequestId(requestId); + iar.setOperationalEnvName("myOpEnv"); + iar.setRequestScope("create"); + iar.setRequestStatus("PENDING"); + iar.setRequestAction("UNKNOWN"); + ObjectMapper mapper = new ObjectMapper(); + stubFor(post(urlPathEqualTo("/infraActiveRequests/")) + .withRequestBody(containing("{\"requestId\":\""+ requestId+"\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withStatus(HttpStatus.SC_OK))); + + stubFor(get(urlPathEqualTo("/infraActiveRequests/"+requestId)) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(mapper.writeValueAsString(iar)) + .withStatus(HttpStatus.SC_OK))); + createVnfOpEnv.execute(requestId, request); + } } |