aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-building-blocks/src/test
diff options
context:
space:
mode:
authorBrittany Plummer (bp896r) <bp896r@att.com>2018-08-28 15:58:07 -0400
committerBrittany Plummer (bp896r) <bp896r@att.com>2018-08-28 15:58:07 -0400
commit3cea07cfa59720df58e85f25081a5e8ff8d004cf (patch)
treedab1b8d87da6c02642abf29f758391029ca421b9 /bpmn/so-bpmn-building-blocks/src/test
parenteb94991c543a1d9cf3c9b6c4dfca921dedf48da5 (diff)
Added GenericVnfHealthCheckBB, tasks, and tests
Issue-ID: SO-777 Change-Id: I8a46f1802feb18ab4df098472fef5373ac42208b Signed-off-by: Brittany Plummer (bp896r) <bp896r@att.com>
Diffstat (limited to 'bpmn/so-bpmn-building-blocks/src/test')
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java4
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/GenericVnfHealthCheckBBTest.java41
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml3
3 files changed, 48 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 f6d81ba771..21b6dd402b 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
@@ -51,6 +51,7 @@ 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.CreateNetwork;
import org.onap.so.bpmn.infrastructure.flowspecific.tasks.CreateNetworkCollection;
+import org.onap.so.bpmn.infrastructure.flowspecific.tasks.GenericVnfHealthCheck;
import org.onap.so.bpmn.infrastructure.flowspecific.tasks.UnassignNetworkBB;
import org.onap.so.bpmn.infrastructure.flowspecific.tasks.UnassignVnf;
import org.onap.so.bpmn.infrastructure.sdnc.tasks.SDNCActivateTasks;
@@ -182,6 +183,9 @@ public abstract class BaseBPMNTest {
@MockBean
protected WorkflowActionBBTasks workflowActionBBTasks;
+ @MockBean
+ protected GenericVnfHealthCheck genericVnfHealthCheck;
+
@LocalServerPort
private int port;
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/GenericVnfHealthCheckBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/GenericVnfHealthCheckBBTest.java
new file mode 100644
index 0000000000..1c882e85d1
--- /dev/null
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/GenericVnfHealthCheckBBTest.java
@@ -0,0 +1,41 @@
+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 GenericVnfHealthCheckBBTest extends BaseBPMNTest {
+
+ @Test
+ public void sunnyDayGenericVnfHealthCheckBBTest() throws InterruptedException, IOException {
+
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("GenericVnfHealthCheckBB", variables);
+ assertThat(pi).isNotNull();
+ assertThat(pi).isStarted().hasPassedInOrder("Start_GenericVnfHealthChkBB", "SetParamsHealthCheck",
+ "Call-AppC-HealthCheck", "End_GenericVnfHealthChkBB");
+ assertThat(pi).isEnded();
+ }
+
+ @Test
+ public void genericVnfHealthCheckBBExceptionTest() throws Exception {
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(genericVnfHealthCheck).setParamsForGenericVnfHealthCheck(any(BuildingBlockExecution.class));
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("GenericVnfHealthCheckBB", variables);
+ assertThat(pi).isNotNull();
+ assertThat(pi).isStarted()
+ .hasPassedInOrder("Start_GenericVnfHealthChkBB", "SetParamsHealthCheck")
+ .hasNotPassed("Call-AppC-HealthCheck", "End_GenericVnfHealthChkBB");
+ assertThat(pi).isEnded();
+ }
+}
+
+
diff --git a/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml b/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml
index d7bb084195..2d102afe9f 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml
+++ b/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml
@@ -67,6 +67,9 @@ mso:
workflow:
message:
endpoint: http://localhost:28090/workflows/messages/message
+ requestDb:
+ auth: Basic YnBlbDptc28tZGItMTUwNyE=
+ endpoint: http://localhost:8081
async:
core-pool-size: 50