diff options
author | shrek2000 <orenkle@amdocs.com> | 2017-09-11 15:45:37 +0300 |
---|---|---|
committer | shrek2000 <orenkle@amdocs.com> | 2017-09-12 10:38:35 +0300 |
commit | c8a540b3c234449163f6fb1899807bba951113b4 (patch) | |
tree | a8aae0dd0f6a0feb27369914e9e3fa321740e7ed /openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java | |
parent | 82d454fd3e8c9fdf66517d01a99019a379dbfdb6 (diff) |
Create new VSP, onboard from TOSCA file - UI
Change-Id: I018c6d07a4b9ec7e6b1507ab37e2550865423cfe
Issue-ID: SDC-230
Signed-off-by: shrek2000 <orenkle@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java')
-rw-r--r-- | openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealerTest.java | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealerTest.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealerTest.java new file mode 100644 index 0000000000..b732cb03b6 --- /dev/null +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealerTest.java @@ -0,0 +1,70 @@ +package org.openecomp.sdc.healing.healers; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.common.utils.SdcCommon; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.HashMap; +import java.util.Map; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; + +public class VspOnboardingMethodHealerTest{ + + @Mock + private VendorSoftwareProductInfoDao vendorSoftwareProductInfoDao; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(VspOnboardingMethodHealerTest.this); + } + + @Test + public void checkHealingWithNullOnboarding() throws Exception{ + VspOnboardingMethodHealer vspOnboardingMethodHealer = new VspOnboardingMethodHealer(vendorSoftwareProductInfoDao); + Map<String,Object> params = new HashMap<>(); + params.put(SdcCommon.VSP_ID,"1"); + params.put(SdcCommon.VERSION, new Version(1,1)); + VspDetails vspDetails = new VspDetails(); + vspDetails.setOnboardingMethod(null); + Mockito.when(vendorSoftwareProductInfoDao.get(any())).thenReturn(vspDetails); + vspOnboardingMethodHealer.heal(params); + assertEquals(vspDetails.getOnboardingMethod(),"NetworkPackage"); + assertEquals(vspDetails.getOnboardingOrigin(),"zip"); + } + + @Test + public void checkHealingWithHEATOnboarding() throws Exception{ + VspOnboardingMethodHealer vspOnboardingMethodHealer = new VspOnboardingMethodHealer(vendorSoftwareProductInfoDao); + Map<String,Object> params = new HashMap<>(); + params.put(SdcCommon.VSP_ID,"1"); + params.put(SdcCommon.VERSION, new Version(1,1)); + VspDetails vspDetails = new VspDetails(); + vspDetails.setOnboardingMethod("HEAT"); + Mockito.when(vendorSoftwareProductInfoDao.get(any())).thenReturn(vspDetails); + vspOnboardingMethodHealer.heal(params); + assertEquals(vspDetails.getOnboardingMethod(),"NetworkPackage"); + assertEquals(vspDetails.getOnboardingOrigin(),"zip"); + } + + @Test + public void checkHealingWithManualOnboarding() throws Exception{ + VspOnboardingMethodHealer vspOnboardingMethodHealer = new VspOnboardingMethodHealer(vendorSoftwareProductInfoDao); + Map<String,Object> params = new HashMap<>(); + params.put(SdcCommon.VSP_ID,"1"); + params.put(SdcCommon.VERSION, new Version(1,1)); + VspDetails vspDetails = new VspDetails(); + vspDetails.setOnboardingMethod("Manual"); + Mockito.when(vendorSoftwareProductInfoDao.get(any())).thenReturn(vspDetails); + vspOnboardingMethodHealer.heal(params); + assertEquals(vspDetails.getOnboardingMethod(),"Manual"); + assertEquals(vspDetails.getOnboardingOrigin(),null); + } +}
\ No newline at end of file |