summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test
diff options
context:
space:
mode:
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>2021-03-18 21:03:32 +0100
committerLukasz Muszkieta <lukasz.muszkieta@nokia.com>2021-03-18 21:03:57 +0100
commit46a0eda4be2662ed48cce9fd25d623b1cc212381 (patch)
tree321400a5e641b87990b638071b7c97c2adae7cb8 /bpmn/MSOCommonBPMN/src/test
parent13d346f36d1fd765afb0e9c3dea88671b0bb3f42 (diff)
helm orchestration artifact type handling
Issue-ID: SO-3484 Signed-off-by: Lukasz Muszkieta <lukasz.muszkieta@nokia.com> Change-Id: Ic1def62bd27554d7c97ebc607d2facefc40fb446
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java9
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java12
2 files changed, 21 insertions, 0 deletions
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 127253a72e..19a69ded8a 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
@@ -29,6 +29,7 @@ import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isA;
@@ -110,6 +111,7 @@ import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization;
import org.onap.so.db.catalog.beans.InstanceGroupType;
import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization;
import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
+import org.onap.so.db.catalog.beans.OrchTemplateArtifactType;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization;
@@ -3278,6 +3280,9 @@ public class BBInputSetupTest {
serviceInstance.getVnfs().add(vnf);
VfModule vfModule1 = new VfModule();
vfModule1.setVfModuleId("vfModuleId1");
+ ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule();
+ modelInfoVfModule.setModelUUID("uuidTest");
+ vfModule1.setModelInfoVfModule(modelInfoVfModule);
VfModule vfModule2 = new VfModule();
vfModule2.setVfModuleId("vfModuleId2");
vnf.getVfModules().add(vfModule1);
@@ -3309,6 +3314,9 @@ public class BBInputSetupTest {
org.onap.aai.domain.yang.VfModule vfModuleAAI = new org.onap.aai.domain.yang.VfModule();
vfModuleAAI.setModelCustomizationId(vfModuleCustomizationId);
+ org.onap.so.db.catalog.beans.VfModule vfModuleFromDatabase = new org.onap.so.db.catalog.beans.VfModule();
+ vfModuleFromDatabase.setOrchTemplateArtifactType(OrchTemplateArtifactType.HELM);
+ doReturn(vfModuleFromDatabase).when(SPY_bbInputSetupUtils).getVfModuleByModelUUID("uuidTest");
doReturn(vnfAAI).when(SPY_bbInputSetupUtils).getAAIGenericVnf(vnf.getVnfId());
doReturn(volumeGroupAAI).when(SPY_bbInputSetupUtils).getAAIVolumeGroup(CLOUD_OWNER,
cloudConfiguration.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId());
@@ -3333,6 +3341,7 @@ public class BBInputSetupTest {
lookupKeyMap.get(ResourceKey.VF_MODULE_ID));
assertEquals("Lookup Key Map populated with VolumeGroup Id", volumeGroupId,
lookupKeyMap.get(ResourceKey.VOLUME_GROUP_ID));
+ assertTrue(parameter.getIsHelm());
}
@Test
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java
index 85774ec23c..6d24dcc996 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java
@@ -79,7 +79,9 @@ import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.MultipleObjectsFoundException;
import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.NoServiceInstanceFoundException;
import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
+import org.onap.so.db.catalog.beans.OrchTemplateArtifactType;
import org.onap.so.db.catalog.beans.Service;
+import org.onap.so.db.catalog.beans.VfModule;
import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.InfraActiveRequests;
@@ -830,6 +832,16 @@ public class BBInputSetupUtilsTest {
assertNull(actualGenericVnfs);
}
+ @Test
+ public void getVfModuleByModelUUID_success() {
+ org.onap.so.db.catalog.beans.VfModule vfModuleFromDatabase = new VfModule();
+ vfModuleFromDatabase.setOrchTemplateArtifactType(OrchTemplateArtifactType.HELM);
+ doReturn(vfModuleFromDatabase).when(MOCK_catalogDbClient).getVfModuleByModelUUID("modelUuidTest");
+ org.onap.so.db.catalog.beans.VfModule vfModuleFromDatabaseResult =
+ bbInputSetupUtils.getVfModuleByModelUUID("modelUuidTest");
+ assertEquals(OrchTemplateArtifactType.HELM, vfModuleFromDatabaseResult.getOrchTemplateArtifactType());
+ }
+
private InfraActiveRequests loadExpectedInfraActiveRequest() throws IOException {
return mapper.readValue(new File(RESOURCE_PATH + "InfraActiveRequestExpected.json"), InfraActiveRequests.class);
}