*/
package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
-
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 CreateNetworkCollectionBBTest extends BaseBPMNTest{
+public class CreateNetworkCollectionBBTest extends BaseBPMNTest {
@Test
public void sunnyDayCreateNetworkCollection_Test() throws InterruptedException {
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkCollectionBB",variables);
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkCollectionBB", variables);
assertThat(pi).isNotNull();
- assertThat(pi).isStarted().hasPassedInOrder("createNetworkCollection_startEvent", "BuildName_ServiceTask", "ServiceTask_create_NetworkCollection", "ServiceTask_create_NetworkCollectionInstanceGroup", "ServiceTask_Connect_Collection_to_InstanceGroup", "ServiceTask_Connect_InstanceGroup_to_CloudRegion", "ServiceTask_Connect_Collection_to_ServiceInstance", "createNetworkCollection_EndEvent");
+ assertThat(pi).isStarted().hasPassedInOrder("createNetworkCollection_startEvent", "BuildName_ServiceTask",
+ "ServiceTask_create_NetworkCollection", "ServiceTask_create_NetworkCollectionInstanceGroup",
+ "ServiceTask_Connect_Collection_to_InstanceGroup", "ServiceTask_Connect_InstanceGroup_to_CloudRegion",
+ "ServiceTask_Connect_Collection_to_ServiceInstance", "createNetworkCollection_EndEvent");
assertThat(pi).isEnded();
}
- @Test
- public void rainyDayCreateNetworkCollection_Test() throws Exception {
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks).createNetworkCollectionInstanceGroup(any(BuildingBlockExecution.class));
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkCollectionBB", variables);
- assertThat(pi).isNotNull();
- assertThat(pi).isStarted()
- .hasPassedInOrder("createNetworkCollection_startEvent", "BuildName_ServiceTask", "ServiceTask_create_NetworkCollection")
- .hasNotPassed("createNetworkCollection_EndEvent");
- assertThat(pi).isEnded();
- }
+ @Test
+ public void rainyDayCreateNetworkCollection_Test() throws Exception {
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiCreateTasks)
+ .createNetworkCollectionInstanceGroup(any(BuildingBlockExecution.class));
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("CreateNetworkCollectionBB", variables);
+ assertThat(pi).isNotNull();
+ assertThat(pi).isStarted().hasPassedInOrder("createNetworkCollection_startEvent", "BuildName_ServiceTask",
+ "ServiceTask_create_NetworkCollection").hasNotPassed("createNetworkCollection_EndEvent");
+ assertThat(pi).isEnded();
+ }
}