1 package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
3 import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
4 import static org.mockito.Matchers.any;
5 import static org.mockito.Mockito.doThrow;
7 import java.io.IOException;
9 import org.camunda.bpm.engine.delegate.BpmnError;
10 import org.camunda.bpm.engine.runtime.ProcessInstance;
12 import org.junit.Test;
13 import org.onap.so.bpmn.BaseBPMNTest;
14 import org.onap.so.bpmn.common.BuildingBlockExecution;
18 public class ConfigurationScaleOutBBTest extends BaseBPMNTest {
21 public void sunnyDayConfigurationScaleOutBBTest() throws InterruptedException, IOException {
22 ProcessInstance pi = runtimeService.startProcessInstanceByKey("ConfigurationScaleOutBB", variables);
23 assertThat(pi).isNotNull();
24 assertThat(pi).isStarted().hasPassedInOrder("Start_ConfigScaleOutBB", "QueryVfModule", "GetConfigScaleOutParams",
25 "Call-AppC-ConfigScaleOut", "End_ConfigScaleOutBB");
26 assertThat(pi).isEnded();
30 public void configurationScaleOutBBExceptionTest() throws Exception {
31 doThrow(new BpmnError("7000", "TESTING ERRORS")).when(sdncQueryTasks).queryVfModule(any(BuildingBlockExecution.class));
32 ProcessInstance pi = runtimeService.startProcessInstanceByKey("ConfigurationScaleOutBB", variables);
33 assertThat(pi).isNotNull();
34 assertThat(pi).isStarted()
35 .hasPassedInOrder("Start_ConfigScaleOutBB", "QueryVfModule")
36 .hasNotPassed("GetConfigScaleOutParams", "Call-AppC-ConfigScaleOut", "End_ConfigScaleOutBB");
37 assertThat(pi).isEnded();