diff options
Diffstat (limited to 'vid-app-common')
2 files changed, 223 insertions, 0 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java b/vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java index c70bbd76a..c165c865d 100644 --- a/vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java @@ -1418,4 +1418,27 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes assertNull(templateOfRetry.getStatusMessage()); } + @Test + public void oneVnfExistsAddAnotherVnf(){ + final String VNF_REQUEST_ID = UUID.randomUUID().toString(); + final String VNF_INSTANCE_ID = UUID.randomUUID().toString(); + + ServiceInstantiation serviceInstantiation = readJsonResourceFileAsObject("/payload_jsons/vnf/one_vnf_exists_add_another_vnf_expected_bulk.json", + ServiceInstantiation.class); + List<UUID> uuids = asyncInstantiationBL.pushBulkJob(serviceInstantiation, USER_ID); + assertThat(uuids, hasSize(1)); + + //mock mso to answer 200 of create vnf instance request + when(restMso.restCall(eq(HttpMethod.POST), eq(RequestReferencesContainer.class), any(), endsWith("e6cc1c4f-05f7-49bc-8e86-ac2eb92baaaa/vnfs"), any())).thenReturn( + createResponse(200, VNF_INSTANCE_ID, VNF_REQUEST_ID)); + + //mock mso to answer msoVnfStatus (COMPLETE) for vnf creation status, + when(restMso.GetForObject(endsWith(VNF_REQUEST_ID), eq(AsyncRequestStatus.class))). + thenReturn(asyncRequestStatusResponseAsRestObject(COMPLETE_STR)); + + processJobsCountTimesAndAssertStatus(uuids.get(0), 200, COMPLETED); + verify(restMso, times(1)).restCall(eq(HttpMethod.POST), any(), any(), endsWith("e6cc1c4f-05f7-49bc-8e86-ac2eb92baaaa/vnfs"), any()); + verify(restMso, times(1)).GetForObject(any(), any()); + } + } diff --git a/vid-app-common/src/test/resources/payload_jsons/vnf/one_vnf_exists_add_another_vnf_expected_bulk.json b/vid-app-common/src/test/resources/payload_jsons/vnf/one_vnf_exists_add_another_vnf_expected_bulk.json new file mode 100644 index 000000000..1eac789af --- /dev/null +++ b/vid-app-common/src/test/resources/payload_jsons/vnf/one_vnf_exists_add_another_vnf_expected_bulk.json @@ -0,0 +1,200 @@ +{ + "action":"None", + "isDirty":true, + "vnfs":{ + "2d324058-615d-4ecf-941f-c95f05253cda": { + "action":"None", + "instanceName":"iperf_vnf_2002_VNF_Instance_101", + "instanceId":"2d324058-615d-4ecf-941f-c95f05253cda", + "orchStatus":"Active", + "productFamilyId":null, + "lcpCloudRegionId":"rdm59a", + "tenantId":"11981b4f7fc4426d905edb1487b53bff", + "cloudOwner":"att-nc", + "modelInfo":{ + "modelCustomizationName":"iperf_vnf_2002_by5924 0", + "modelCustomizationId":"fe200ee4-96bb-4a10-9022-a188a20cf145", + "modelInvariantId":"0153d3b3-0354-489f-89fd-5e7a54afb783", + "modelVersionId":"c8087818-6f3e-4451-b339-111a1a3e7970", + "modelName":"iperf_vnf_2002_by5924", + "modelType":"vnf", + "modelVersion":"2.0" + }, + "instanceType":"iperf_vnf_2002_by5924/iperf_vnf_2002_by5924 0", + "provStatus":"PREPROV", + "inMaint":false, + "uuid":"c8087818-6f3e-4451-b339-111a1a3e7970", + "originalName":"iperf_vnf_2002_by5924 0", + "legacyRegion":null, + "lineOfBusiness":null, + "platformName":null, + "trackById":"2d324058-615d-4ecf-941f-c95f05253cda", + "vfModules":{ + "iperf_vnf_2002_by59240..IperfVnf2002By5924..base..module-0":{ + "c9d679cc-ee3e-4c2b-be48-bc3ee797c026":{ + "action":"None", + "instanceName":"zrdm59aIperf01_base_01", + "instanceId":"c9d679cc-ee3e-4c2b-be48-bc3ee797c026", + "orchStatus":"Active", + "productFamilyId":null, + "lcpCloudRegionId":"rdm59a", + "tenantId":"11981b4f7fc4426d905edb1487b53bff", + "cloudOwner":"att-nc", + "modelInfo":{ + "modelCustomizationName":"IperfVnf2002By5924..base..module-0", + "modelCustomizationId":"949ceef3-366b-4e4e-b0f5-40eb1972ad56", + "modelInvariantId":"4a03b70b-85e3-4e67-a4ff-4123021c1278", + "modelVersionId":"73c3470f-acb9-4180-bd60-31ff7aacc094", + "modelName":"IperfVnf2002By5924..base..module-0", + "modelType":"vfModule", + "modelVersion":"1" + }, + "instanceType":null, + "provStatus":null, + "inMaint":false, + "uuid":"73c3470f-acb9-4180-bd60-31ff7aacc094", + "originalName":"iperf_vnf_2002_by59240..IperfVnf2002By5924..base..module-0", + "legacyRegion":null, + "lineOfBusiness":null, + "platformName":null, + "trackById":"c9d679cc-ee3e-4c2b-be48-bc3ee797c026", + "isBase":true, + "volumeGroupName":null + } + } + }, + "networks":{ + "588e6ce0-1c77-45a9-808b-3c4085e3ed70":{ + "action":"None", + "instanceName":"GRP-29576-T-E2E-16-SDN_int_iperf_net_1", + "instanceId":"588e6ce0-1c77-45a9-808b-3c4085e3ed70", + "orchStatus":"Active", + "lcpCloudRegionId":"rdm59a", + "tenantId":"11981b4f7fc4426d905edb1487b53bff", + "cloudOwner":"att-nc", + "modelInfo":{ + "modelCustomizationId":"bc548bf7-1b6a-428d-a7bf-76e7238a7aa8", + "modelInvariantId":"ffb9e45c-e674-4289-aad3-00040ad746e4", + "modelVersionId":"01f4c475-3f89-4f00-a2f4-39a873dba0ae", + "modelName":"NETWORK_CLOUD_PROVIDER_NETWORK", + "modelType":"network", + "modelVersion":"1.0" + }, + "instanceType":"SR-IOV-PROVIDER2-1", + "inMaint":false, + "uuid":"01f4c475-3f89-4f00-a2f4-39a873dba0ae", + "trackById":"588e6ce0-1c77-45a9-808b-3c4085e3ed70", + "role":"int_iperf_net_1", + "physicalName":"sriovnet1", + "serviceName":"int_iperf_svc1", + "serviceUUID":"a9c285e2-6bb9-4877-876e-62c4ac0eadd2", + "tenantName":"GRP-29576-T-E2E-16-SDN", + "boundToVpn":false + }, + "ca61e4c9-982b-4d5f-b9eb-eaaf1cf23b9e":{ + "action":"None", + "instanceName":"GRP-29576-T-E2E-16-SDN_oam_protected_net_2", + "instanceId":"ca61e4c9-982b-4d5f-b9eb-eaaf1cf23b9e", + "orchStatus":"Active", + "lcpCloudRegionId":"rdm59a", + "tenantId":"11981b4f7fc4426d905edb1487b53bff", + "cloudOwner":"att-nc", + "modelInfo":{ + "modelCustomizationId":"23c382c9-9405-4780-8794-e57eb015883d", + "modelInvariantId":"ffb9e45c-e674-4289-aad3-00040ad746e4", + "modelVersionId":"01f4c475-3f89-4f00-a2f4-39a873dba0ae", + "modelName":"NETWORK_CLOUD_PROVIDER_NETWORK", + "modelType":"network", + "modelVersion":"1.0" + }, + "instanceType":"NEUTRON-PROVIDER", + "inMaint":false, + "uuid":"01f4c475-3f89-4f00-a2f4-39a873dba0ae", + "trackById":"ca61e4c9-982b-4d5f-b9eb-eaaf1cf23b9e", + "role":"oam_protected_net_2", + "physicalName":"oam", + "serviceName":"oam_protected_net_svc1", + "serviceUUID":"ce2821fc-3b28-4759-9613-1e514d7563c0", + "tenantName":"GRP-29576-T-E2E-16-SDN", + "boundToVpn":false + } + }, + "vnfStoreKey":"2d324058-615d-4ecf-941f-c95f05253cda" + }, + "iperf_vnf_2002_by5924 0":{ + "action":"Create", + "inMaint":false, + "rollbackOnFailure":"true", + "originalName":"iperf_vnf_2002_by5924 0", + "isMissingData":false, + "trackById":"4y617gs2h1q", + "vfModules":{}, + "vnfStoreKey":"iperf_vnf_2002_by5924 0", + "upgradedVFMSonsCounter":0, + "instanceName":null, + "productFamilyId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "lcpCloudRegionId":"hvf6", + "tenantId":"229bcdc6eaeb4ca59d55221141d01f8e", + "platformName":"xxx1", + "lineOfBusiness":"zzz1", + "instanceParams":[{}], + "modelInfo":{ + "modelInvariantId":"0153d3b3-0354-489f-89fd-5e7a54afb783", + "modelVersionId":"c8087818-6f3e-4451-b339-111a1a3e7970", + "modelName":"iperf_vnf_2002_by5924", + "modelVersion":"2.0", + "modelCustomizationId":"fe200ee4-96bb-4a10-9022-a188a20cf145", + "modelCustomizationName":"iperf_vnf_2002_by5924 0", + "uuid":"c8087818-6f3e-4451-b339-111a1a3e7970", + "modelUniqueId":"fe200ee4-96bb-4a10-9022-a188a20cf145"}, + "uuid":"c8087818-6f3e-4451-b339-111a1a3e7970" + } + }, + "vrfs":{}, + "instanceParams":[], + "validationCounter":0, + "existingNames":{ + "iperf_vnf_svc1":"" + }, + "existingVNFCounterMap":{ + "fe200ee4-96bb-4a10-9022-a188a20cf145":2 + }, + "existingVRFCounterMap":{}, + "existingVnfGroupCounterMap":{}, + "existingNetworksCounterMap":{}, + "networks":{}, + "vnfGroups":{}, + "bulkSize":1, + "instanceName":"iperf_vnf_svc1", + "instanceId":"e6cc1c4f-05f7-49bc-8e86-ac2eb92baaaa", + "orchStatus":"Active", + "productFamilyId":null, + "lcpCloudRegionId":null, + "tenantId":null, + "cloudOwner":null, + "modelInfo":{ + "modelInvariantId":"1a94f1d1-ab7a-412e-bf2f-9d02d551e9de", + "modelVersionId":"82255513-e19f-46e5-bdfb-957c6bf57b82", + "modelName":"iperf_vnf_2002_by5924", + "modelType":"service", + "modelVersion":"2.0" + }, + "globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "subscriptionServiceType":"Mobility", + "owningEntityId":null, + "owningEntityName":null, + "tenantName":null, + "aicZoneId":null, + "aicZoneName":null, + "projectName":null, + "rollbackOnFailure":false, + "isALaCarte":true, + "collectionResources":{}, + "testApi":"GR_API", + "vidNotions":{ + "instantiationUI":"anyAlacarteWhichNotExcluded", + "modelCategory":"5G Fabric Configuration", + "viewEditUI":"legacy", + "instantiationType":"ALaCarte" + } +}
\ No newline at end of file |