From a3d6343980633633f8ed144a20a2460277c98b83 Mon Sep 17 00:00:00 2001 From: amitjai Date: Thu, 4 Jan 2018 18:52:19 +0530 Subject: Fix issue Null pointer exception If feature group list is empty or null we should ignore check. Change-Id: I6fcf20501353f6f32ad166a6096074f4f393dd00 Issue-ID: SDC-876 Signed-off-by: amitjai --- .../impl/DeploymentFlavorManagerImplTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test') diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java index be53a1a71a..1c2aade1fe 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java @@ -149,6 +149,22 @@ public class DeploymentFlavorManagerImplTest { } } + @Test + public void testCreateManualDepFlavorWithNoFGNInDFAndInVSP() { + DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID); + final DeploymentFlavor deploymentFlavor = + JsonUtil.json2Object(expected.getCompositionData(), DeploymentFlavor.class); + deploymentFlavor.setFeatureGroupId(null); + expected.setCompositionData(JsonUtil.object2Json(deploymentFlavor)); + + doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject()); + + VspDetails vspDetails = new VspDetails(VSP_ID, VERSION); + doReturn(vspDetails).when(vspInfoDao).get(anyObject()); + deploymentFlavorManager.createDeploymentFlavor(expected); + verify(compositionEntityDataManagerMock).createDeploymentFlavor(expected); + } + @Test public void testCreateManualDepFlavorWithNullCompInAssociation() { DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID); -- cgit 1.2.3-korg