diff options
Diffstat (limited to 'vid-automation')
4 files changed, 163 insertions, 14 deletions
diff --git a/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java index ab59f087d..721c9ead6 100644 --- a/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java +++ b/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java @@ -22,7 +22,6 @@ import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; -import vid.automation.test.Constants; import vid.automation.test.Constants.Users; import vid.automation.test.model.User; import vid.automation.test.services.AsyncJobsService; @@ -77,18 +76,34 @@ public class InstantiationTemplatesApiTest extends AsyncInstantiationBase { @Test public void templateTopology_givenDeployFromCypressE2E_getTemplateTopologyDataIsEquivalent() throws IOException { - templateTopology_givenDeploy_templateTopologyIsEquivalent(objectMapper.readValue( - convertRequest(objectMapper, "asyncInstantiation/templates__instance_template.json"), - JsonNode.class)); + templateTopology_givenDeploy_templateTopologyIsEquivalentToBody( + fileAsJsonNode("asyncInstantiation/templates__instance_template.json")); } - public void templateTopology_givenDeploy_templateTopologyIsEquivalent(JsonNode body) { + @Test + public void templateTopology_givenDeployFromEditedTemplateCypressE2E_getTemplateTopologyDataIsEquivalentToOriginalTemplate() throws IOException { + templateTopology_givenDeploy_templateTopologyIsEquivalent( + fileAsJsonNode("asyncInstantiation/templates__instance_from_template__set_without_modify.json"), + fileAsJsonNode("asyncInstantiation/templates__instance_template.json")); + } + + private JsonNode fileAsJsonNode(String fileName) throws IOException { + return objectMapper.readValue( + convertRequest(objectMapper, fileName), + JsonNode.class); + } + + public void templateTopology_givenDeploy_templateTopologyIsEquivalentToBody(JsonNode body) { + templateTopology_givenDeploy_templateTopologyIsEquivalent(body, body); + } + + public void templateTopology_givenDeploy_templateTopologyIsEquivalent(JsonNode body, JsonNode expectedTemplateTopology) { registerExpectationFromPreset(new PresetAAIGetSubscribersGet(), RegistrationStrategy.CLEAR_THEN_SET); String uuid1 = postAsyncInstanceRequest(body); JsonNode templateTopology1 = restTemplate.getForObject(templateTopologyUri(uuid1), JsonNode.class); - assertThat(cleanupTemplate(templateTopology1), jsonEquals(cleanupTemplate(body))); + assertThat(cleanupTemplate(templateTopology1), jsonEquals(cleanupTemplate(expectedTemplateTopology))); } private JsonNode cleanupTemplate(JsonNode templateTopology) { diff --git a/vid-automation/src/test/resources/aaiGetInstanceTopology/ServiceTreeWithMultipleChildren_serviceModel.json b/vid-automation/src/test/resources/aaiGetInstanceTopology/ServiceTreeWithMultipleChildren_serviceModel.json index 013745c90..d602a15e3 100644 --- a/vid-automation/src/test/resources/aaiGetInstanceTopology/ServiceTreeWithMultipleChildren_serviceModel.json +++ b/vid-automation/src/test/resources/aaiGetInstanceTopology/ServiceTreeWithMultipleChildren_serviceModel.json @@ -331,7 +331,7 @@ "baseModule": false }, "inputs": {}, - "volumeGroupAllowed": false + "volumeGroupAllowed": true }, "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": { "uuid": "41708296-e443-4c71-953f-d9a010f059e1", @@ -367,18 +367,18 @@ "baseModule": true }, "inputs": {}, - "volumeGroupAllowed": true + "volumeGroupAllowed": false } }, "volumeGroups": { - "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": { + "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-1": { "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", "description": null, - "name": "VfVgeraldine..base_vflorence..module-0", + "name": "VfVgeraldine..base_vflorence..module-1", "version": "2", - "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0", + "modelCustomizationName": "VfVgeraldine..base_vflorence..module-1", "properties": { "minCountInstances": 1, "maxCountInstances": 1, diff --git a/vid-automation/src/test/resources/asyncInstantiation/templates__instance_from_template__set_without_modify.json b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_from_template__set_without_modify.json new file mode 100644 index 000000000..5a327fdd7 --- /dev/null +++ b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_from_template__set_without_modify.json @@ -0,0 +1,132 @@ +{ + "action": "Create", + "instanceName": "vProbe_NC_Service_DG_new_SI", + "productFamilyId": null, + "lcpCloudRegionId": null, + "tenantId": null, + "modelInfo": { + "modelInvariantId": "90a32d31-8a01-4de2-a91f-7e2414d6f5aa", + "modelVersionId": "6cfeeb18-c2b0-49df-987a-da47493c8e38", + "modelName": "vProbe_NC_Service", + "modelType": "service", + "modelVersion": "1.0" + }, + "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89", + "subscriptionServiceType": "TYLER SILVIA", + "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc", + "owningEntityName": "WayneHolland", + "tenantName": null, + "aicZoneId": null, + "aicZoneName": null, + "projectName": "WATKINS", + "subscriberName": "SILVIA ROBBINS", + "rollbackOnFailure": "true", + "isALaCarte": true, + "testApi": "GR_API", + "trackById": "36601560-f8e3-4020-bdef-3e4709c51e84", + "existingVNFCounterMap": { + "024a417d-ca46-40bf-95ce-809c6a269011": 1 + }, + "existingVRFCounterMap": {}, + "existingVnfGroupCounterMap": {}, + "existingNetworksCounterMap": {}, + "existingNames": { + }, + "vnfs": { + "vProbe_NC_VNF 0": { + "modelInfo": { + "modelCustomizationName": "vProbe_NC_VNF 0", + "modelCustomizationId": "024a417d-ca46-40bf-95ce-809c6a269011", + "modelInvariantId": "a6a96924-b9c5-4c85-ae18-cbfca848095e", + "modelVersionId": "21ae311e-432f-4c54-b855-446d0b8ded72", + "modelName": "vProbe_NC_VNF", + "modelType": "vnf", + "modelVersion": "1.0" + }, + "productFamilyId": "e433710f-9217-458d-a79d-1c7aff376d89", + "instanceName": "hvf6arlba007", + "action": "Create", + "platformName": "xxx1", + "lcpCloudRegionId": "hvf6", + "tenantId": "4914ab0ab3a743e58f0eefdacc1dde77", + "instanceParams": [ + {} + ], + "rollbackOnFailure": true, + "instanceId": null, + "vfModules": { + "vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0": { + "vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0ahubg": { + "modelInfo": { + "modelCustomizationName": "VprobeNcVnf..FE_base_module..module-0", + "modelCustomizationId": "4d0818cf-eaa9-4a3f-89c2-639953089e14", + "modelInvariantId": "29b6fa3c-aeb3-4103-b3f7-6f98e097b005", + "modelVersionId": "c5b26cc1-a66f-4b69-aa23-6abc7c647c88", + "modelName": "VprobeNcVnf..FE_base_module..module-0", + "modelType": "vfModule", + "modelVersion": "1" + }, + "instanceName": "hvf6arlba007_lba_Base_01", + "action": "Create", + "lcpCloudRegionId": "hvf6", + "tenantId": "4914ab0ab3a743e58f0eefdacc1dde77", + "instanceParams": [ + {} + ], + "rollbackOnFailure": true, + "trackById": "ea2879a6-10bc-4697-90d7-7bc3e71da0fd", + "isFailed": false + } + }, + "vprobe_nc_vnf0..VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1": { + "vprobe_nc_vnf0..VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1yprvi": { + "modelInfo": { + "modelCustomizationName": "VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1", + "modelCustomizationId": "9b99d340-a80b-45ef-9ff1-993fa3e4c001", + "modelInvariantId": "1bcc4824-6c1a-4b51-af7c-076b7fc14d05", + "modelVersionId": "c09e4530-8fd8-418f-9483-2f57ce927b05", + "modelName": "VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1", + "modelType": "vfModule", + "modelVersion": "1" + }, + "instanceName": "my_hvf6arlba007_lba_dj_01", + "action": "Create", + "lcpCloudRegionId": "hvf6", + "tenantId": "4914ab0ab3a743e58f0eefdacc1dde77", + "instanceParams": [ + {} + ], + "rollbackOnFailure": true, + "trackById": "b134410e-3bc0-478e-883e-1b6bdf8a28df", + "isFailed": false, + "volumeGroupName": "my_special_hvf6arlba007_lba_dj_01_vol", + "sdncPreLoad": true + } + } + }, + "trackById": "1d2848a0-3573-4d29-b3dd-60bb263260ea", + "isFailed": false, + "statusMessage": null, + "position": null, + "lineOfBusiness": "zzz1" + } + }, + "networks": {}, + "vrfs": {}, + "vnfGroups": {}, + "instanceParams": [ + {} + ], + "pause": false, + "bulkSize": 1, + "instanceId": null, + "isFailed": false, + "statusMessage": null, + "vidNotions": { + "instantiationUI": "anyAlacarteWhichNotExcluded", + "modelCategory": "5G Fabric Configuration", + "viewEditUI": "legacy", + "instantiationType": "ALaCarte" + }, + "position": null +} diff --git a/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json index a7b3a04c5..5a327fdd7 100644 --- a/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json +++ b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json @@ -30,6 +30,8 @@ "existingVRFCounterMap": {}, "existingVnfGroupCounterMap": {}, "existingNetworksCounterMap": {}, + "existingNames": { + }, "vnfs": { "vProbe_NC_VNF 0": { "modelInfo": { @@ -87,7 +89,7 @@ "modelType": "vfModule", "modelVersion": "1" }, - "instanceName": "hvf6arlba007_lba_dj_01", + "instanceName": "my_hvf6arlba007_lba_dj_01", "action": "Create", "lcpCloudRegionId": "hvf6", "tenantId": "4914ab0ab3a743e58f0eefdacc1dde77", @@ -97,8 +99,8 @@ "rollbackOnFailure": true, "trackById": "b134410e-3bc0-478e-883e-1b6bdf8a28df", "isFailed": false, - "volumeGroupInstanceName": "hvf6arlba007_lba_dj_01_vol", - "usePreload": true + "volumeGroupName": "my_special_hvf6arlba007_lba_dj_01_vol", + "sdncPreLoad": true } } }, |