diff options
author | Ittay Stern <ittay.stern@att.com> | 2020-03-05 17:25:34 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-03-08 09:49:29 +0200 |
commit | 17b63f0c432f9edf407e4c9f465a295bfd870485 (patch) | |
tree | e6109422808147976bb4a1930f68c1eef3dfad08 /vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java | |
parent | f7c41b1c4aeea09e67c8bb88f39d15e02cd1708f (diff) |
isVfModuleBaseModule() will not throw on model mismatch
In addition, the model-info comparision is by customization id or
customization name instead of the version id.
Issue-ID: VID-603
Change-Id: I8efee06f470e5d5681c264de01ed1315ee1f8cc6
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/job/impl/AsyncInstantiationIntegrationTest.java | 21 |
1 files changed, 10 insertions, 11 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 642adb307..6b15c879f 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 @@ -67,7 +67,6 @@ import static org.testng.AssertJUnit.assertTrue; import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import java.io.IOException; import java.lang.reflect.Method; import java.util.Collection; import java.util.Collections; @@ -458,13 +457,11 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes when(restMso.GetForObject(endsWith(VNF_REQUEST_ID), eq(AsyncRequestStatus.class))). thenReturn(asyncRequestStatusResponseAsRestObject(COMPLETE_STR)); - try { - reset(commandUtils); - when(commandUtils.isVfModuleBaseModule(SERVICE_MODEL_VERSION_ID, VF_MODULE_0_MODEL_VERSION_ID)).thenReturn(true); - when(commandUtils.isVfModuleBaseModule(SERVICE_MODEL_VERSION_ID, VF_MODULE_1_MODEL_VERSION_ID)).thenReturn(false); - } catch (AsdcCatalogException e) { - - } + reset(commandUtils); + when(commandUtils.isVfModuleBaseModule(eq(SERVICE_MODEL_VERSION_ID), + argThat(it -> it.getModelCustomizationId().equals(VF_MODULE_0_MODEL_CUSTOMIZATION_NAME)))).thenReturn(true); + when(commandUtils.isVfModuleBaseModule(eq(SERVICE_MODEL_VERSION_ID), + argThat(it -> it.getModelCustomizationId().equals(VF_MODULE_1_MODEL_CUSTOMIZATION_NAME)))).thenReturn(false); /*---------- vf Module without volume group name (base) -----------*/ @@ -1015,10 +1012,12 @@ public class AsyncInstantiationIntegrationTest extends AsyncInstantiationBaseTes RestObject<AsyncRequestStatus> createStatusResponse, RestObject<AsyncRequestStatus> deleteStatusResponse, JobStatus expectedJobStatus, - int getStatusCounter) throws IOException, AsdcCatalogException { + int getStatusCounter) { - when(commandUtils.isVfModuleBaseModule("6b528779-44a3-4472-bdff-9cd15ec93450", "f8360508-3f17-4414-a2ed-6bc71161e8db")).thenReturn(true); - when(commandUtils.isVfModuleBaseModule("6b528779-44a3-4472-bdff-9cd15ec93450", "25284168-24bb-4698-8cb4-3f509146eca5")).thenReturn(false); + when(commandUtils.isVfModuleBaseModule(eq("6b528779-44a3-4472-bdff-9cd15ec93450"), + argThat(it -> it.getModelCustomizationName().equals("2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0")))).thenReturn(true); + when(commandUtils.isVfModuleBaseModule(eq("6b528779-44a3-4472-bdff-9cd15ec93450"), + argThat(it -> it.getModelCustomizationName().equals("2017488PasqualeVpe..PASQUALE_vRE_BV..module-1")))).thenReturn(false); createAndDeleteIntegrationTest("/payload_jsons/vfModuleDelete1Create1None1Request.json", "/serviceInstantiation/v7/serviceInstances/f8791436-8d55-4fde-b4d5-72dd2cf13cfb/vnfs/VNF_INSTANCE_ID/vfModules", |