diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2020-01-16 14:54:41 +0200 |
---|---|---|
committer | Eylon Malin <eylon.malin@intl.att.com> | 2020-01-19 12:23:47 +0200 |
commit | 284de1d0f9e93bf661bbca4074b6531d6d5385c1 (patch) | |
tree | eebeaced5cfdac5d3a17ced8b2f3f03f40c36ae8 /vid-app-common/src/test/java/org | |
parent | adef7f90d338e0e93e3a3d0a6f714f0270a9b7f1 (diff) |
originalName stored and sent to frontend in a template
Issue-ID: VID-724
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Change-Id: Ie18e16fed62f9a92a4b4d5c72596c36303de1f48
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org')
5 files changed, 27 insertions, 24 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/job/command/ResourceCommandTest.java b/vid-app-common/src/test/java/org/onap/vid/job/command/ResourceCommandTest.java index db856d757..b916347d2 100644 --- a/vid-app-common/src/test/java/org/onap/vid/job/command/ResourceCommandTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/job/command/ResourceCommandTest.java @@ -279,7 +279,7 @@ public class ResourceCommandTest { convertToMap(networks), convertToMap(vnfGroups), null, - null, false, 1, false,false,null, null, null, null, null, null, null); + null, false, 1, false,false,null, null, null, null, null, null, null, null); } public static ServiceInstantiation createServiceWith2InstancesInEachLevel(Action action) { @@ -298,11 +298,11 @@ public class ResourceCommandTest { static InstanceGroup createGroup(List<InstanceGroupMember> groupMembers, Action action) { return new InstanceGroup(mock(ModelInfo.class), null, action.name(), false, null, convertToMap(groupMembers), null, null, null, - null); + null, null); } static InstanceGroupMember createMember(Action action) { - return new InstanceGroupMember(null, action.toString(), null, null, null, null); + return new InstanceGroupMember(null, action.toString(), null, null, null, null, null); } static Vnf createVnf(List<VfModule> vfModules, Action action) { @@ -310,22 +310,22 @@ public class ResourceCommandTest { vfModulesMap.put("abc",convertToMap(vfModules)); return new Vnf(mock(ModelInfo.class), null, null, action.toString(), null, null, null, null, null, null, false, null, vfModulesMap, null, null, null, - null); + null, null); } static Vnf createVnf(Action action) { return new Vnf(mock(ModelInfo.class), null, null, action.toString(), null, null, null, null, null, null, false, null,null, null, null, null, - null); + null, null); } static VfModule createVfModule(Action action) { return new VfModule(mock(ModelInfo.class), null, null, action.toString(), null, null, null, null, null, - false, false, null, null, null, null, null, null, null); + false, false, null, null, null, null, null, null, null, null); } static Network createNetwork(Action action) { return new Network(mock(ModelInfo.class), null, null, action.toString(), null, null, null, null, null, null, false, null, null, null, null, - null); + null, null); } } diff --git a/vid-app-common/src/test/java/org/onap/vid/model/serviceInstantiation/InstantiationModelSerializationTest.java b/vid-app-common/src/test/java/org/onap/vid/model/serviceInstantiation/InstantiationModelSerializationTest.java index b7ae76915..f0c96b839 100644 --- a/vid-app-common/src/test/java/org/onap/vid/model/serviceInstantiation/InstantiationModelSerializationTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/model/serviceInstantiation/InstantiationModelSerializationTest.java @@ -94,7 +94,8 @@ public class InstantiationModelSerializationTest { new VidNotions(InstantiationUI.ANY_ALACARTE_WHICH_NOT_EXCLUDED, ModelCategory.INFRASTRUCTURE_VPN, InstantiationUI.INFRASTRUCTURE_VPN, - InstantiationType.Macro) + InstantiationType.Macro), + "originalName" ); verifySerializationAndDeserialization(serviceInstantiation); @@ -119,7 +120,8 @@ public class InstantiationModelSerializationTest { "trackById", true, "statusMessage", - 5); + 5, + "originalName"); verifySerializationAndDeserialization(vnf); } @@ -151,7 +153,8 @@ public class InstantiationModelSerializationTest { "statusMessage", true, true, - 1); + 1, + "originalName"); verifySerializationAndDeserialization(vfModule); } @@ -164,7 +167,7 @@ public class InstantiationModelSerializationTest { VfModule vfModule = new VfModule(newModelInfo(), null, null, null, null, null, null, null, null, false, /* HERE ====> */ USE_PRELOAD, - null, null, null, null, null, null, null); + null, null, null, null, null, null, null, null); assertThat(vfModule, jsonPartEquals("sdncPreLoad", USE_PRELOAD)); assertThat(vfModule, jsonNodeAbsent("usePreload")); @@ -179,7 +182,7 @@ public class InstantiationModelSerializationTest { /* HERE ====> */ VOLUME_GROUP_INSTANCE_NAME, null, null, null, null, null, null, false, null, null, null, null, null, - null, null, null); + null, null, null, null); assertThat(vfModule, jsonPartEquals("volumeGroupName", VOLUME_GROUP_INSTANCE_NAME)); assertThat(vfModule, jsonNodeAbsent("volumeGroupInstanceName")); diff --git a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java index e2fd38c4a..f61131770 100644 --- a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java @@ -237,7 +237,7 @@ public class AsyncInstantiationBaseTest extends AbstractTestNGSpringContextTests testApi, instanceId, action.name(), - UUID.randomUUID().toString(), null, null, null); + UUID.randomUUID().toString(), null, null, null, null); } private List<Map<String,String>> createInstanceParams() { @@ -266,12 +266,12 @@ public class AsyncInstantiationBaseTest extends AbstractTestNGSpringContextTests return new VfModule(vfModuleInfo, instanceName, volumeGroupInstanceName, Action.Create.name(), "mdt1", null, "88a6ca3ee0394ade9403f075db23167e", instanceParams, supplementaryParams, false, usePreload, null, UUID.randomUUID().toString(), null, null, - null, null, null); + null, null, null, "originalName"); } return new VfModule(vfModuleInfo, instanceName, volumeGroupInstanceName, Action.Create.name(), null, null, null, instanceParams, supplementaryParams, false, false, null, UUID.randomUUID().toString(), null, - null, null, null, null); + null, null, null, null, "originalName"); } protected ModelInfo createVfModuleModelInfo(String modelName, String modelVersion, String modelVersionId, String modelInvariantId, String modelCustomizationId, String modelCustomizationName) { @@ -281,7 +281,7 @@ public class AsyncInstantiationBaseTest extends AbstractTestNGSpringContextTests protected VfModule createVfModuleForReplace(ModelInfo vfModuleModelInfo, String instanceName, String lcpCloudRegionId, String tenantId, Boolean retainAssignments, Boolean retainVolumeGroups, List<UserParamNameAndValue> supplementaryParams) { return new VfModule( vfModuleModelInfo, instanceName, null, Action.Upgrade.name(), lcpCloudRegionId, null, tenantId, - null, supplementaryParams, true, null, null, UUID.randomUUID().toString(), null, null, retainAssignments, retainVolumeGroups, null); + null, supplementaryParams, true, null, null, UUID.randomUUID().toString(), null, null, retainAssignments, retainVolumeGroups, null, "originalName"); } protected ModelInfo createVnfModelInfo(boolean isAlacarte) { @@ -366,7 +366,7 @@ public class AsyncInstantiationBaseTest extends AbstractTestNGSpringContextTests Vnf vnf = new Vnf(vnfModelInfo, "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", (isUserProvidedNaming ? VNF_NAME : null), Action.Create.name(), "platformName", "mdt1", null, "88a6ca3ee0394ade9403f075db23167e", vnfInstanceParams,"lineOfBusinessName" , false, null, vfModules, - UUID.randomUUID().toString(), null, null, null); + UUID.randomUUID().toString(), null, null, null, "originalName"); vnfs.put(vnf.getModelInfo().getModelName(), vnf); return vnfs; @@ -398,7 +398,7 @@ public class AsyncInstantiationBaseTest extends AbstractTestNGSpringContextTests "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", null, "MOG", lcpCloudRegionId, null, tenantId, null, null, null, Collections.EMPTY_MAP, Collections.EMPTY_MAP, Collections.EMPTY_MAP, Collections.EMPTY_MAP, instanceParams, false, 1, false, false, null, null, null, null, null, null, - new VidNotions(InstantiationUI.TRANSPORT_SERVICE, ModelCategory.Transport, InstantiationUI.TRANSPORT_SERVICE, InstantiationType.Macro) + new VidNotions(InstantiationUI.TRANSPORT_SERVICE, ModelCategory.Transport, InstantiationUI.TRANSPORT_SERVICE, InstantiationType.Macro), "originalName" ); return serviceInstantiation; } @@ -419,7 +419,7 @@ public class AsyncInstantiationBaseTest extends AbstractTestNGSpringContextTests details->new Network(createNetworkModelInfo(isALaCarte, details.modelCustomizationId), "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", details.name, Action.Create.name(), "platformName", "mdt1", null, "88a6ca3ee0394ade9403f075db23167e", instanceParams,"lineOfBusinessName" , - false, null, UUID.randomUUID().toString(), null, null, null)); + false, null, UUID.randomUUID().toString(), null, null, null, "originalName")); // I can't tell why compiler don't like the statement if it's only one line... return networkStream.collect(Collectors.toMap(network -> network.getModelInfo().getModelCustomizationId(), network -> network)); } @@ -435,7 +435,7 @@ public class AsyncInstantiationBaseTest extends AbstractTestNGSpringContextTests modelInfo.setModelVersion("10.0"); return new InstanceGroup(modelInfo, (isUserProvidedNaming ? VNF_GROUP_NAME : null), action.name(), false, null, emptyMap(), UUID.randomUUID().toString(), null, null, - null); + null, "originalName"); } protected ModelInfo createServiceModelInfo() { diff --git a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java index a1e4af2c4..284efce45 100644 --- a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java @@ -1056,7 +1056,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT public void whenLcpRegionNotEmpty_thenCloudRegionIdOfResourceIsLegacy() { String legacyCloudRegion = "legacyCloudRegion"; Vnf vnf = new Vnf(new ModelInfo(), null, null, Action.Create.name(), null, "anyCloudRegion", legacyCloudRegion, - null, null, null, false, null, null, UUID.randomUUID().toString(), null, null, null); + null, null, null, false, null, null, UUID.randomUUID().toString(), null, null, null, "originalName"); assertThat(vnf.getLcpCloudRegionId(), equalTo(legacyCloudRegion)); } @@ -1065,7 +1065,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT String legacyCloudRegion = "legacyCloudRegion"; ServiceInstantiation service = new ServiceInstantiation(new ModelInfo(), null, null, null, null, null, null, null, null, "anyCloudRegion", legacyCloudRegion, null, null, null, null, null, null, null, null, null, - false, 1,false, false, null, null, Action.Create.name(), UUID.randomUUID().toString(), null, null, null); + false, 1,false, false, null, null, Action.Create.name(), UUID.randomUUID().toString(), null, null, null, "originalName"); assertThat(service.getLcpCloudRegionId(), equalTo(legacyCloudRegion)); } @@ -1089,7 +1089,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT return new ServiceInstantiation(new ModelInfo(), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, 1, false, isALaCarte, null, null, action.name(), - UUID.randomUUID().toString(), null, null, null); + UUID.randomUUID().toString(), null, null, null, "originalName"); } @DataProvider 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 58a069ba2..71d38b3f8 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 @@ -526,7 +526,7 @@ public class MsoRequestBuilderTest extends AsyncInstantiationBaseTest { "}"; Vnf vnfDetails = new Vnf(createVnfModelInfo(true), "productFamily", "instanceName", Action.Delete.name(), "platform", "AAIAIC25", null, "092eb9e8e4b7412e8787dd091bc58e86", null, null, false, "VNF_INSTANCE_ID", null, UUID.randomUUID().toString(), null, null, - null); + null, "originalName"); RequestDetailsWrapper<VnfInstantiationRequestDetails> result = msoRequestBuilder.generateDeleteVnfRequest(vnfDetails, "az2018"); MsoOperationalEnvironmentTest.assertThatExpectationIsLikeObject(expected, result); |