diff options
author | Brittany Plummer (bp896r) <bp896r@att.com> | 2018-09-04 15:08:30 -0400 |
---|---|---|
committer | Brittany Plummer (bp896r) <bp896r@att.com> | 2018-09-04 15:08:30 -0400 |
commit | b61935a908f4742773400af6431ead046efafa4f (patch) | |
tree | cc7803d228b2e0bf88db907535f2b8f842c8b9d0 /bpmn/so-bpmn-building-blocks/src/test/java | |
parent | fed9afbf5d8bb9ce342836668380cd491c74b67e (diff) |
Added ConfigurationScaleOutBB, tasks, and tests
Issue-ID: SO-765
Change-Id: I7e0e902f00417b8c2439962f9ebfed6cc117a86e
Signed-off-by: Brittany Plummer (bp896r) <bp896r@att.com>
Diffstat (limited to 'bpmn/so-bpmn-building-blocks/src/test/java')
2 files changed, 43 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java index 21b6dd402b..e8891eeb53 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java @@ -49,6 +49,7 @@ import org.onap.so.bpmn.infrastructure.adapter.vnf.tasks.VnfAdapterImpl; import org.onap.so.bpmn.infrastructure.flowspecific.tasks.AssignNetwork; import org.onap.so.bpmn.infrastructure.flowspecific.tasks.AssignNetworkBBUtils; import org.onap.so.bpmn.infrastructure.flowspecific.tasks.AssignVnf; +import org.onap.so.bpmn.infrastructure.flowspecific.tasks.ConfigurationScaleOut; import org.onap.so.bpmn.infrastructure.flowspecific.tasks.CreateNetwork; import org.onap.so.bpmn.infrastructure.flowspecific.tasks.CreateNetworkCollection; import org.onap.so.bpmn.infrastructure.flowspecific.tasks.GenericVnfHealthCheck; @@ -186,6 +187,9 @@ public abstract class BaseBPMNTest { @MockBean protected GenericVnfHealthCheck genericVnfHealthCheck; + @MockBean + protected ConfigurationScaleOut configurationScaleOut; + @LocalServerPort private int port; diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ConfigurationScaleOutBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ConfigurationScaleOutBBTest.java new file mode 100644 index 0000000000..edf131d538 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ConfigurationScaleOutBBTest.java @@ -0,0 +1,39 @@ +package org.onap.so.bpmn.infrastructure.bpmn.subprocess; + +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doThrow; + +import java.io.IOException; + +import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.runtime.ProcessInstance; + +import org.junit.Test; +import org.onap.so.bpmn.BaseBPMNTest; +import org.onap.so.bpmn.common.BuildingBlockExecution; + + + +public class ConfigurationScaleOutBBTest extends BaseBPMNTest { + + @Test + public void sunnyDayConfigurationScaleOutBBTest() throws InterruptedException, IOException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ConfigurationScaleOutBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("Start_ConfigScaleOutBB", "QueryVfModule", "GetConfigScaleOutParams", + "Call-AppC-ConfigScaleOut", "End_ConfigScaleOutBB"); + assertThat(pi).isEnded(); + } + + @Test + public void configurationScaleOutBBExceptionTest() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncQueryTasks).queryVfModule(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("ConfigurationScaleOutBB", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted() + .hasPassedInOrder("Start_ConfigScaleOutBB", "QueryVfModule") + .hasNotPassed("GetConfigScaleOutParams", "Call-AppC-ConfigScaleOut", "End_ConfigScaleOutBB"); + assertThat(pi).isEnded(); + } +} |