diff options
author | Alexey Sandler <alexey.sandler@intl.att.com> | 2020-03-16 21:47:40 +0200 |
---|---|---|
committer | Alexey Sandler <alexey.sandler@intl.att.com> | 2020-03-16 21:47:40 +0200 |
commit | 6b57c89aa2ceda72126576c8cdb58b75e83df6f1 (patch) | |
tree | 8424b3969939a943170753577add63c1ad352f7d | |
parent | 212533a0274fd52384c02b929d435e4fb6aeed82 (diff) |
API test to verify simpleNoTaskInfo format
Use new format when fetching Orchestration requests from MSO to the CM dashboard
Issue-ID: VID-787
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Change-Id: Id426ee13ce9dede540d7807cb836f1bb6db420c2
3 files changed, 261 insertions, 112 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetNoTaskInfoBody.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetNoTaskInfoBody.java index 652abbec8..ac57ebbc0 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetNoTaskInfoBody.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetNoTaskInfoBody.java @@ -31,128 +31,130 @@ public class PresetMSOOrchestrationRequestsGetNoTaskInfoBody extends BaseMSOPres @Override public Object getResponseBody() { return "" + - " \"requestList\": [" - + " {" - + " \"request\": {" - + " \"requestId\": \"f01fbb5d-c964-44d4-9080-00e83eae419f\"," - + " \"startTime\": \"Mon, 05 Aug 2019 12:49:35 GMT\"," - + " \"finishTime\": \"Mon, 05 Aug 2019 12:50:24 GMT\"," - + " \"requestScope\": \"vnf\"," - + " \"requestType\": \"updateInstance\"," - + " \"requestDetails\": {" - + " \"modelInfo\": {" - + " \"modelCustomizationName\": \"FEXN_5G_NC_VSP 0\"," - + " \"modelInvariantId\": \"5fc21c6e-3ca3-4641-90f0-1e2ae66b20be\"," - + " \"modelType\": \"vnf\"," - + " \"modelName\": \"FEXN_5G_NC_VSP\"," - + " \"modelVersion\": \"2\"," - + " \"modelCustomizationUuid\": \"2ba4f9f3-765f-4172-802e-a56a912c221c\"," - + " \"modelVersionId\": \"9ba01811-84ea-4878-9fd7-7a0a280e0572\"," - + " \"modelCustomizationId\": \"2ba4f9f3-765f-4172-802e-a56a912c221c\"," - + " \"modelUuid\": \"9ba01811-84ea-4878-9fd7-7a0a280e0572\"," - + " \"modelInvariantUuid\": \"5fc21c6e-3ca3-4641-90f0-1e2ae66b20be\"," - + " \"modelInstanceName\": \"FEXN_5G_NC_VSP 0\"" - + " }," - + " \"requestInfo\": {" - + " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"," - + " \"source\": \"VID\"," - + " \"instanceName\": \"PST-VNF-1810-None-4751\"," - + " \"suppressRollback\": false," - + " \"requestorId\": \"yy3692\"" - + " }," - + " \"relatedInstanceList\": [" - + " {" - + " \"relatedInstance\": {" - + " \"instanceId\": \"a06c0d0b-ae17-42fb-b9b5-4b3a93a7be11\"," - + " \"modelInfo\": {" - + " \"modelInvariantId\": \"abb333ce-c66a-4670-b44a-17fe6a4963f3\"," - + " \"modelType\": \"service\"," - + " \"modelName\": \"test_VNF_01_by5924\"," - + " \"modelVersion\": \"2\"," - + " \"modelVersionId\": \"6c756dd3-ffa5-4162-b1a8-501e4a643707\"," - + " \"modelUuid\": \"6c756dd3-ffa5-4162-b1a8-501e4a643707\"," - + " \"modelInvariantUuid\": \"abb333ce-c66a-4670-b44a-17fe6a4963f3\"" - + " }" + "{" + + " \"requestList\": [" + + " {" + + " \"request\": {" + + " \"requestId\": \"f01fbb5d-c964-44d4-9080-00e83eae419f\"," + + " \"startTime\": \"Mon, 05 Aug 2019 12:49:35 GMT\"," + + " \"finishTime\": \"Mon, 05 Aug 2019 12:50:24 GMT\"," + + " \"requestScope\": \"vnf\"," + + " \"requestType\": \"updateInstance\"," + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelCustomizationName\": \"FEXN_5G_NC_VSP 0\"," + + " \"modelInvariantId\": \"5fc21c6e-3ca3-4641-90f0-1e2ae66b20be\"," + + " \"modelType\": \"vnf\"," + + " \"modelName\": \"FEXN_5G_NC_VSP\"," + + " \"modelVersion\": \"2\"," + + " \"modelCustomizationUuid\": \"2ba4f9f3-765f-4172-802e-a56a912c221c\"," + + " \"modelVersionId\": \"9ba01811-84ea-4878-9fd7-7a0a280e0572\"," + + " \"modelCustomizationId\": \"2ba4f9f3-765f-4172-802e-a56a912c221c\"," + + " \"modelUuid\": \"9ba01811-84ea-4878-9fd7-7a0a280e0572\"," + + " \"modelInvariantUuid\": \"5fc21c6e-3ca3-4641-90f0-1e2ae66b20be\"," + + " \"modelInstanceName\": \"FEXN_5G_NC_VSP 0\"" + + " }," + + " \"requestInfo\": {" + + " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"," + + " \"source\": \"VID\"," + + " \"instanceName\": \"PST-VNF-1810-None-4751\"," + + " \"suppressRollback\": false," + + " \"requestorId\": \"yy3692\"" + + " }," + + " \"relatedInstanceList\": [" + + " {" + + " \"relatedInstance\": {" + + " \"instanceId\": \"a06c0d0b-ae17-42fb-b9b5-4b3a93a7be11\"," + + " \"modelInfo\": {" + + " \"modelInvariantId\": \"abb333ce-c66a-4670-b44a-17fe6a4963f3\"," + + " \"modelType\": \"service\"," + + " \"modelName\": \"test_VNF_01_by5924\"," + + " \"modelVersion\": \"2\"," + + " \"modelVersionId\": \"6c756dd3-ffa5-4162-b1a8-501e4a643707\"," + + " \"modelUuid\": \"6c756dd3-ffa5-4162-b1a8-501e4a643707\"," + + " \"modelInvariantUuid\": \"abb333ce-c66a-4670-b44a-17fe6a4963f3\"" + " }" + " }" - + " ]," - + " \"cloudConfiguration\": {" - + " \"tenantId\": \"1c099363f335409ea47df3c8db61397a\"," - + " \"cloudOwner\": \"irma-aic\"," - + " \"lcpCloudRegionId\": \"mdt19b\"" - + " }," - + " \"requestParameters\": {" - + " \"aLaCarte\": true," - + " \"testApi\": \"GR_API\"" - + " }," - + " \"platform\": {" - + " \"platformName\": \"None Platform - Collab\"" - + " }," - + " \"lineOfBusiness\": {" - + " \"lineOfBusinessName\": \"None_LOB - Collab\"" + " }" + + " ]," + + " \"cloudConfiguration\": {" + + " \"tenantId\": \"1c099363f335409ea47df3c8db61397a\"," + + " \"cloudOwner\": \"irma-aic\"," + + " \"lcpCloudRegionId\": \"mdt19b\"" + " }," - + " \"instanceReferences\": {" - + " \"serviceInstanceId\": \"a06c0d0b-ae17-42fb-b9b5-4b3a93a7be11\"," - + " \"vnfInstanceId\": \"569cd880-e095-466a-b97d-97bb46fea257\"," - + " \"vnfInstanceName\": \"PST-VNF-1810-None-4751\"," - + " \"requestorId\": \"yy3692\"" + + " \"requestParameters\": {" + + " \"aLaCarte\": true," + + " \"testApi\": \"GR_API\"" + " }," - + " \"requestStatus\": {" - + " \"requestState\": \"ROLLED_BACK\"," - + " \"statusMessage\": \"STATUS: Error Source: SDNC, Error Message: Unable to find l3-network in AAI for network role sgi_direct_net_2 FLOW STATUS: All Rollback flows have completed successfully ROLLBACK STATUS: Rollback has been completed successfully.\"," - + " \"percentProgress\": 100," - + " \"timestamp\": \"Mon, 05 Aug 2019 12:50:24 GMT\"" + + " \"platform\": {" + + " \"platformName\": \"None Platform - Collab\"" + + " }," + + " \"lineOfBusiness\": {" + + " \"lineOfBusinessName\": \"None_LOB - Collab\"" + " }" + + " }," + + " \"instanceReferences\": {" + + " \"serviceInstanceId\": \"a06c0d0b-ae17-42fb-b9b5-4b3a93a7be11\"," + + " \"vnfInstanceId\": \"569cd880-e095-466a-b97d-97bb46fea257\"," + + " \"vnfInstanceName\": \"PST-VNF-1810-None-4751\"," + + " \"requestorId\": \"yy3692\"" + + " }," + + " \"requestStatus\": {" + + " \"requestState\": \"ROLLED_BACK\"," + + " \"statusMessage\": \"STATUS: Error Source: SDNC, Error Message: Unable to find l3-network in AAI for network role sgi_direct_net_2 FLOW STATUS: All Rollback flows have completed successfully ROLLBACK STATUS: Rollback has been completed successfully.\"," + + " \"percentProgress\": 100," + + " \"timestamp\": \"Mon, 05 Aug 2019 12:50:24 GMT\"" + " }" - + " }," - + " {" - + " \"request\": {" - + " \"requestId\": \"64970886-ed75-4837-8bf1-0eb472fe65e6\"," - + " \"startTime\": \"Fri, 06 Mar 2020 23:07:48 GMT\"," - + " \"finishTime\": \"Fri, 06 Mar 2020 23:08:40 GMT\"," - + " \"requestScope\": \"vnf\"," - + " \"requestType\": \"replaceInstance\"," - + " \"requestDetails\": {" - + " \"modelInfo\": {" - + " \"modelCustomizationName\": \"L3VPNvRR-RESOURCE 0\"," - + " \"modelInvariantId\": \"fdb84cd2-87d8-4b22-bf47-b3ef765d2c11\"," - + " \"modelType\": \"vnf\"," - + " \"modelNameVersionId\": \"fdb84cd2-87d8-4b22-bf47-b3ef765d2c11\"," - + " \"modelName\": \"L3VPNvRR-RESOURCE\"," - + " \"modelVersion\": \"1\"," - + " \"modelInvariantUuid\": \"fdb84cd2-87d8-4b22-bf47-b3ef765d2c11\"," - + " \"modelInstanceName\": \"L3VPNvRR-RESOURCE 0\"" - + " }," - + " \"requestInfo\": {" - + " \"source\": \"VID\"," - + " \"suppressRollback\": false," - + " \"requestorId\": \"ROBOT\"" - + " }," - + " \"cloudConfiguration\": {" - + " \"tenantId\": \"78491aac74be4fab9873db114774b475\"," - + " \"cloudOwner\": \"irma-aic\"," - + " \"lcpCloudRegionId\": \"dyh2b\"" - + " }," - + " \"requestParameters\": {" - + " \"testApi\": \"GR_API\"" - + " }" + + " }" + + " }," + + " {" + + " \"request\": {" + + " \"requestId\": \"64970886-ed75-4837-8bf1-0eb472fe65e6\"," + + " \"startTime\": \"Fri, 06 Mar 2020 23:07:48 GMT\"," + + " \"finishTime\": \"Fri, 06 Mar 2020 23:08:40 GMT\"," + + " \"requestScope\": \"vnf\"," + + " \"requestType\": \"replaceInstance\"," + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelCustomizationName\": \"L3VPNvRR-RESOURCE 0\"," + + " \"modelInvariantId\": \"fdb84cd2-87d8-4b22-bf47-b3ef765d2c11\"," + + " \"modelType\": \"vnf\"," + + " \"modelNameVersionId\": \"fdb84cd2-87d8-4b22-bf47-b3ef765d2c11\"," + + " \"modelName\": \"L3VPNvRR-RESOURCE\"," + + " \"modelVersion\": \"1\"," + + " \"modelInvariantUuid\": \"fdb84cd2-87d8-4b22-bf47-b3ef765d2c11\"," + + " \"modelInstanceName\": \"L3VPNvRR-RESOURCE 0\"" + " }," - + " \"instanceReferences\": {" - + " \"serviceInstanceId\": \"e648ee86-c091-4d38-8573-99893cd79bfa\"," - + " \"vnfInstanceId\": \"9a2b3dd1-5fd9-4cb4-a47f-b4f0e8e678e3\"," - + " \"vnfInstanceName\": \"PST-VNF-2002-None-943501\"," + + " \"requestInfo\": {" + + " \"source\": \"VID\"," + + " \"suppressRollback\": false," + " \"requestorId\": \"ROBOT\"" + " }," - + " \"requestStatus\": {" - + " \"requestState\": \"COMPLETE\"," - + " \"statusMessage\": \"STATUS: ALaCarte-Vnf-deleteInstance request was executed correctly. FLOW STATUS: Successfully completed all Building Blocks\"," - + " \"percentProgress\": 100," - + " \"timestamp\": \"Fri, 06 Mar 2020 23:08:40 GMT\"" + + " \"cloudConfiguration\": {" + + " \"tenantId\": \"78491aac74be4fab9873db114774b475\"," + + " \"cloudOwner\": \"irma-aic\"," + + " \"lcpCloudRegionId\": \"dyh2b\"" + + " }," + + " \"requestParameters\": {" + + " \"testApi\": \"GR_API\"" + " }" + + " }," + + " \"instanceReferences\": {" + + " \"serviceInstanceId\": \"e648ee86-c091-4d38-8573-99893cd79bfa\"," + + " \"vnfInstanceId\": \"9a2b3dd1-5fd9-4cb4-a47f-b4f0e8e678e3\"," + + " \"vnfInstanceName\": \"PST-VNF-2002-None-943501\"," + + " \"requestorId\": \"ROBOT\"" + + " }," + + " \"requestStatus\": {" + + " \"requestState\": \"COMPLETE\"," + + " \"statusMessage\": \"STATUS: ALaCarte-Vnf-deleteInstance request was executed correctly. FLOW STATUS: Successfully completed all Building Blocks\"," + + " \"percentProgress\": 100," + + " \"timestamp\": \"Fri, 06 Mar 2020 23:08:40 GMT\"" + " }" + " }" - + " ]"; + + " }" + + " ]" + + "}"; } } diff --git a/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java index 6416244aa..108506e6d 100644 --- a/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java +++ b/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java @@ -1,5 +1,6 @@ package org.onap.vid.api; +import static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsEqual.equalTo; @@ -7,7 +8,6 @@ import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.onap.vid.api.ChangeManagementUserApiLoggingTest.MSO_GET_CHANGE_MANAGEMENTS_SCALEOUT; import static org.onap.vid.api.TestUtils.getNestedPropertyInMap; import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertFalse; import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; import com.google.common.collect.ImmutableList; @@ -302,12 +302,13 @@ public class ChangeManagementApiTest extends BaseApiTest { @Test @FeatureTogglingTest(Features.FLAG_EXP_USE_FORMAT_PARAMETER_FOR_CM_DASHBOARD) - public void getOrchestrationForDashboardShouldResponseWithFullBody() { + public void getOrchestrationForDashboardShouldResponseWithNoTaskInfoBody() { SimulatorApi.registerExpectation(MSO_GET_CHANGE_MANAGEMENTS_SCALEOUT, RegistrationStrategy.CLEAR_THEN_SET); SimulatorApi.registerExpectationFromPreset(new PresetMSOOrchestrationRequestsGetNoTaskInfoBody(), APPEND); ResponseEntity<String> responseEntity = restTemplate.getForEntity(buildUri(CHANGE_MANAGEMENT + MSO ), String.class); - assertFalse(responseEntity.getBody().contains("requestProcessingData")); + String expected = getResourceAsString("changeManagement/responseNoTaskInfoBody.json"); + assertThat(responseEntity.getBody(), jsonEquals(expected)); } diff --git a/vid-automation/src/test/resources/changeManagement/responseNoTaskInfoBody.json b/vid-automation/src/test/resources/changeManagement/responseNoTaskInfoBody.json new file mode 100644 index 000000000..39737c7cf --- /dev/null +++ b/vid-automation/src/test/resources/changeManagement/responseNoTaskInfoBody.json @@ -0,0 +1,146 @@ +[ + { + "finishTime": "Mon, 05 Aug 2019 12:50:24 GMT", + "requestDetails": { + "cloudConfiguration": { + "lcpCloudRegionId": "mdt19b", + "tenantId": "1c099363f335409ea47df3c8db61397a", + "cloudOwner": "irma-aic" + }, + "modelInfo": { + "modelCustomizationName": "FEXN_5G_NC_VSP 0", + "modelCustomizationId": "2ba4f9f3-765f-4172-802e-a56a912c221c", + "modelInvariantId": "5fc21c6e-3ca3-4641-90f0-1e2ae66b20be", + "modelVersionId": "9ba01811-84ea-4878-9fd7-7a0a280e0572", + "modelName": "FEXN_5G_NC_VSP", + "modelType": "vnf", + "modelVersion": "2" + }, + "requestInfo": { + "instanceName": "PST-VNF-1810-None-4751", + "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "source": "VID", + "suppressRollback": false, + "requestorId": "yy3692" + }, + "requestParameters": { + "testApi": "GR_API", + "userParams": [], + "aLaCarte": true + }, + "relatedInstanceList": [ + { + "relatedInstance": { + "instanceId": "a06c0d0b-ae17-42fb-b9b5-4b3a93a7be11", + "modelInfo": { + "modelInvariantId": "abb333ce-c66a-4670-b44a-17fe6a4963f3", + "modelVersionId": "6c756dd3-ffa5-4162-b1a8-501e4a643707", + "modelName": "test_VNF_01_by5924", + "modelType": "service", + "modelVersion": "2" + } + } + } + ], + "lineOfBusiness": { + "lineOfBusinessName": "None_LOB - Collab" + }, + "platform": { + "platformName": "None Platform - Collab" + } + }, + "requestId": "f01fbb5d-c964-44d4-9080-00e83eae419f", + "requestScope": "vnf", + "requestStatus": { + "percentProgress": 100.0, + "requestState": "ROLLED_BACK", + "statusMessage": "STATUS: Error Source: SDNC, Error Message: Unable to find l3-network in AAI for network role sgi_direct_net_2 FLOW STATUS: All Rollback flows have completed successfully ROLLBACK STATUS: Rollback has been completed successfully.", + "timestamp": "Mon, 05 Aug 2019 12:50:24 GMT" + }, + "requestType": "updateInstance", + "startTime": "Mon, 05 Aug 2019 12:49:35 GMT", + "instanceReferences": { + "serviceInstanceId": "a06c0d0b-ae17-42fb-b9b5-4b3a93a7be11", + "vnfInstanceId": "569cd880-e095-466a-b97d-97bb46fea257", + "vnfInstanceName": "PST-VNF-1810-None-4751", + "requestorId": "yy3692" + } + }, + { + "finishTime": "Fri, 06 Mar 2020 23:08:40 GMT", + "requestDetails": { + "cloudConfiguration": { + "lcpCloudRegionId": "dyh2b", + "tenantId": "78491aac74be4fab9873db114774b475", + "cloudOwner": "irma-aic" + }, + "modelInfo": { + "modelCustomizationName": "L3VPNvRR-RESOURCE 0", + "modelInvariantId": "fdb84cd2-87d8-4b22-bf47-b3ef765d2c11", + "modelName": "L3VPNvRR-RESOURCE", + "modelNameVersionId": "fdb84cd2-87d8-4b22-bf47-b3ef765d2c11", + "modelType": "vnf", + "modelVersion": "1" + }, + "requestInfo": { + "source": "VID", + "suppressRollback": false, + "requestorId": "ROBOT" + }, + "requestParameters": { + "testApi": "GR_API", + "userParams": [] + } + }, + "requestId": "64970886-ed75-4837-8bf1-0eb472fe65e6", + "requestScope": "vnf", + "requestStatus": { + "percentProgress": 100.0, + "requestState": "COMPLETE", + "statusMessage": "STATUS: ALaCarte-Vnf-deleteInstance request was executed correctly. FLOW STATUS: Successfully completed all Building Blocks", + "timestamp": "Fri, 06 Mar 2020 23:08:40 GMT" + }, + "requestType": "replaceInstance", + "startTime": "Fri, 06 Mar 2020 23:07:48 GMT", + "instanceReferences": { + "serviceInstanceId": "e648ee86-c091-4d38-8573-99893cd79bfa", + "vnfInstanceId": "9a2b3dd1-5fd9-4cb4-a47f-b4f0e8e678e3", + "vnfInstanceName": "PST-VNF-2002-None-943501", + "requestorId": "ROBOT" + } + }, + { + "requestId": "2a22aff4-620f-44b6-92a1-8a41be396d96\n\n", + "requestScope": "vfModule", + "requestStatus": { + "percentProgress": 100.0, + "requestState": "IN_PROGRESS", + "statusMessage": "Scale-Out Is In Progress", + "finishTime": "Fri, 08 Sep 2017 19:34:33 GMT" + }, + "requestType": "scaleOut", + "startTime": "Fri, 08 Sep 2017 19:34:32 GMT", + "instanceReferences": { + "serviceInstanceId": "6dd0f8de-93c7-48a2-914b-1a8d58e0eb48", + "vnfInstanceId": "7c00cc1e-6425-4fc3-afc3-0289db288d4c", + "requestorId": "ds828e" + } + }, + { + "requestId": "2d6502bf-c488-4903-817e-2ed2c644dcf4", + "requestScope": "vfModule", + "requestStatus": { + "percentProgress": 100.0, + "requestState": "COMPLETE", + "statusMessage": "Completed successfully", + "finishTime": "Thu, 09 Nov 2017 10:58:14 GMT" + }, + "requestType": "scaleOut", + "startTime": "Thu, 09 Nov 2017 10:58:14 GMT", + "instanceReferences": { + "serviceInstanceId": "54ba3628-9ee5-4b32-8a2a-3abf001bed4e", + "vnfInstanceId": "b8d99523-1e83-4fd1-b42f-849361ef7024", + "requestorId": "az2016" + } + } +]
\ No newline at end of file |