From fd0f5f41dccae8837045314a3b34a473b62e474b Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan" Date: Thu, 2 Apr 2020 15:18:37 -0400 Subject: updated bbinput setup to pull vf if no vnf found updated bbinput setup to pull vf if no vnf found updated name of unit test as its a compilation error updated pom to get logging analytics library fix broken test by removing vnf from service fixed test as mock for setup utils was not correct Issue-ID: SO-2783 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I1077ef934b19980d3fecd839e5f383555aa72d1d --- .../tasks/BBInputSetupTest.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'bpmn/MSOCommonBPMN/src/test/java') diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index df7337c0d9..21b0d834dd 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -2946,6 +2946,32 @@ public class BBInputSetupTest { assertThat(vfModule.getModelInfoVfModule(), sameBeanAs(modelInfoVfModule)); } + @Test + public void testMapCatalogVfModuleIfNoVnf() { + String vnfModelCustomizationUUID = "vnfResourceCustUUID"; + String vfModuleCustomizationUUID = "vfModelCustomizationUUID"; + VfModule vfModule = new VfModule(); + ModelInfo modelInfo = new ModelInfo(); + modelInfo.setModelCustomizationUuid(vfModuleCustomizationUUID); + Service service = new Service(); + VnfResourceCustomization vnfResourceCust = new VnfResourceCustomization(); + vnfResourceCust.setModelCustomizationUUID(vnfModelCustomizationUUID); + VfModuleCustomization vfModuleCust = new VfModuleCustomization(); + vfModuleCust.setModelCustomizationUUID(vfModuleCustomizationUUID); + vnfResourceCust.getVfModuleCustomizations().add(vfModuleCust); + ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule(); + doReturn(vfModuleCust).when(SPY_bbInputSetupUtils) + .getVfModuleCustomizationByModelCuztomizationUUID(vfModuleCustomizationUUID); + doReturn(modelInfoVfModule).when(bbInputSetupMapperLayer).mapCatalogVfModuleToVfModule(vfModuleCust); + + SPY_bbInputSetup.mapCatalogVfModule(vfModule, modelInfo, service, vnfModelCustomizationUUID); + + assertThat(vfModule.getModelInfoVfModule(), sameBeanAs(modelInfoVfModule)); + + verify(SPY_bbInputSetupUtils, times(1)) + .getVfModuleCustomizationByModelCuztomizationUUID(modelInfo.getModelCustomizationId()); + } + @Test public void testPopulateVfModule() throws Exception { String vnfId = "vnfId"; -- cgit 1.2.3-korg