aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/test/java')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java b/vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java
index 71d38b3f8..ef2a6a5fb 100644
--- a/vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java
@@ -659,24 +659,36 @@ public class MsoRequestBuilderTest extends AsyncInstantiationBaseTest {
assertThat(generatedVfModuleReplaceRequest(retainAssignments, retainVolumeGroups, null), jsonEquals(expected).when(IGNORING_ARRAY_ORDER));
}
+ @Test
+ public void generateReplaceVfModuleRequestWithoutCloudConfiguration_verifyResultAsExpected() {
+ String expected = TestUtils.readFileAsString("/payload_jsons/vfmodule/replace_vfmodule__payload_to_mso.json");
+ assertThat(generatedVfModuleReplaceRequestWithOrWithoutCloudConfiguration(null, null, null, true), jsonNodeAbsent("requestDetails.cloudConfiguration"));
+ assertThat(generatedVfModuleReplaceRequestWithOrWithoutCloudConfiguration(null, null, null, true), jsonEquals(expected).whenIgnoringPaths("requestDetails.cloudConfiguration").when(IGNORING_ARRAY_ORDER));
+ }
+
private RequestDetailsWrapper<VfModuleOrVolumeGroupRequestDetails> generatedVfModuleReplaceRequest(
Boolean retainAssignments, Boolean retainVolumeGroups, List<UserParamNameAndValue> supplementaryParams) {
+ return generatedVfModuleReplaceRequestWithOrWithoutCloudConfiguration(retainAssignments, retainVolumeGroups, supplementaryParams, false);
+ }
+
+ private RequestDetailsWrapper<VfModuleOrVolumeGroupRequestDetails> generatedVfModuleReplaceRequestWithOrWithoutCloudConfiguration(
+ Boolean retainAssignments, Boolean retainVolumeGroups, List<UserParamNameAndValue> supplementaryParams, Boolean noHomingData) {
when(featureManager.isActive(Features.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST)).thenReturn(true);
when(aaiClient.getCloudOwnerByCloudRegionId("regionOne")).thenReturn("irma-aic");
ModelInfo vfModuleModelInfo = createVfModuleModelInfo("newest-model-name-vfm", "newest-model-version-vfm", "newest-model-uuid-vfm",
"f7a867f2-596b-4f4a-a128-421e825a6190", "newest-model-customization-uuid-vfm","newest-model-customization-name-vfm" );
- VfModule vfModuleDetails = createVfModuleForReplace(vfModuleModelInfo, "replace_module", "regionOne", "0422ffb57ba042c0800a29dc85ca70f8",
- retainAssignments, retainVolumeGroups, supplementaryParams);
+ VfModule vfModuleDetails = createVfModuleForReplace(vfModuleModelInfo, "replace_module", noHomingData? null : "regionOne", noHomingData? null :"0422ffb57ba042c0800a29dc85ca70f8",
+ retainAssignments, retainVolumeGroups, supplementaryParams);
ModelInfo serviceModelInfo = createServiceModelInfo("newest-model-name-service", "newest-model-version-service", "newest-model-uuid-service", "b16a9398-ffa3-4041-b78c-2956b8ad9c7b", null, null );
ModelInfo vnfModelInfo = createVnfModelInfo("newest-model-name-vnf", "newest-model-version-vnf", "newest-model-uuid-vnf", "23122c9b-dd7f-483f-bf0a-e069303db2f7", "newest-model-customization-uuid-vnf", "newest-model-customization-name-vnf" );
return msoRequestBuilder.generateVfModuleReplaceRequest(vfModuleDetails, serviceModelInfo,
- "e9993045-cc96-4f3f-bf9a-71b2a400a956", vnfModelInfo,
- "5c9c2896-1fe6-4055-b7ec-d0a01e5f9bf5", null, "az2016", "GR_API"
+ "e9993045-cc96-4f3f-bf9a-71b2a400a956", vnfModelInfo,
+ "5c9c2896-1fe6-4055-b7ec-d0a01e5f9bf5", null, "az2016", "GR_API"
);
}
}