summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src/test
diff options
context:
space:
mode:
authorMarcus G K Williams <marcus.williams@intel.com>2018-10-25 07:49:31 -0700
committerMarcus G K Williams <marcus.williams@intel.com>2018-10-29 13:29:13 -0700
commit649c4e85cc991ffe9c13fd3fab4cc3a303faa656 (patch)
tree7122a2cb3f58cdcb2f79fd59fabdb266b4f5c627 /bpmn/so-bpmn-infrastructure-common/src/test
parent6c2c8a66fade016f74b51bdfea3ba04494530b97 (diff)
Fix Error, Check that vimID is present
Issue-ID: SO-1156 Change-Id: I14445f0e6dbed00b37a189f3a7c05923c6d4e5ab Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/test')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy88
1 files changed, 87 insertions, 1 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy
index 84da045450..d0ded39146 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy
@@ -31,6 +31,7 @@ import org.junit.Test
import org.junit.Ignore
import org.mockito.MockitoAnnotations
import org.camunda.bpm.engine.delegate.BpmnError
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.domain.HomingSolution
import org.onap.so.bpmn.mock.FileUtil
@@ -195,7 +196,53 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.preProcessRequest(mex) }))
}
-
+
+ @Test
+ @Ignore
+ public void preProcessRequest_vimId() {
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ UrnPropertiesReader
+
+ def req = request
+ .replace('"mdt1"', '"CloudOwner_CloudRegion1"')
+
+ when(mex.getVariable("bpmnRequest")).thenReturn(req)
+ when(mex.getVariable("URN_mso_workflow_aai_distribution_delay")).thenReturn("PT5S")
+ when(mex.getVariable("aai.workflowAaiDistributionDelay")).thenReturn("PT5S")
+
+ CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService()
+ CreateVcpeResCustService.preProcessRequest(mex)
+
+ verify(mex).setVariable("cloudRegionId", "CloudRegion1")
+ verify(mex).setVariable("cloudOwner", "CloudOwner")
+ }
+
+ @Test
+ @Ignore
+ public void preProcessRequest_noVimId() {
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+
+ def req = request
+ .replace('"mdt1"', '"CloudRegion1_"')
+
+ when(mex.getVariable("bpmnRequest")).thenReturn(req)
+ when(mex.getVariable("URN_mso_workflow_aai_distribution_delay")).thenReturn(60)
+ when(mex.getVariable("URN_mso_workflow_aai_distribution_delay")).thenReturn("PT5S")
+ when(mex.getVariable("aai.workflowAaiDistributionDelay")).thenReturn("PT5S")
+
+ CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService()
+ CreateVcpeResCustService.preProcessRequest(mex)
+
+ verify(mex).setVariable("cloudRegionId", "CloudRegion1_")
+ verify(mex).setVariable("cloudOwner", "my-cloud-owner")
+
+ }
+
+
@Test
// @Ignore
public void preProcessRequest_BpmnError() {
@@ -579,6 +626,45 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
verify(mex).setVariable("cloudOwner", "my-cloud-owner")
verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba")
}
+
+ @Test
+ public void prepareVnfAndModulesCreate_noVimId() {
+ ExecutionEntity mex = setupMock()
+ initPrepareVnfAndModulesCreate(mex)
+
+ def req = request
+ .replace('"mdt1"', '"CloudRegion1_"')
+
+ when(mex.getVariable("createVcpeServiceRequest")).thenReturn(req)
+
+ CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService()
+ CreateVcpeResCustService.prepareVnfAndModulesCreate(mex)
+
+ verify(mex).setVariable("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
+ verify(mex).setVariable("cloudRegionId", "CloudRegion1_")
+ verify(mex).setVariable("lcpCloudRegionId", "CloudRegion1_")
+ verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba")
+ }
+
+ @Test
+ public void prepareVnfAndModulesCreate_vimId() {
+ ExecutionEntity mex = setupMock()
+ initPrepareVnfAndModulesCreate(mex)
+
+ def req = request
+ .replace('"mdt1"', '"CloudOwner_CloudRegion1"')
+
+ when(mex.getVariable("createVcpeServiceRequest")).thenReturn(req)
+
+ CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService()
+ CreateVcpeResCustService.prepareVnfAndModulesCreate(mex)
+
+ verify(mex).setVariable("productFamilyId", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
+ verify(mex).setVariable("cloudOwner", "CloudOwner")
+ verify(mex).setVariable("cloudRegionId", "CloudRegion1")
+ verify(mex).setVariable("lcpCloudRegionId", "CloudRegion1")
+ verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba")
+ }
@Test
// @Ignore