use of org.onap.so.bpmn.common.BuildingBlockExecution in project so by onap.
the class UnassignServiceInstanceBBTest method sunnyDayUnassignServiceInstanceSDNC.
@Test
public void sunnyDayUnassignServiceInstanceSDNC() throws InterruptedException {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
BuildingBlockExecution bbe = new DelegateExecutionImpl(new ExecutionImpl());
variables.put("gBuildingBlockExecution", bbe);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("UnassignServiceInstanceBB", variables);
assertThat(pi).isNotNull();
assertThat(pi).isStarted().hasPassedInOrder("Start_UnassignServiceInstanceBB", "Task_SdncUnassignServiceInstance", "CallActivity_sdncHandlerCall", "Task_AAIDeleteServiceInstance", "End_UnassignServiceInstanceBB");
assertThat(pi).isEnded();
}
use of org.onap.so.bpmn.common.BuildingBlockExecution in project so by onap.
the class ConfigAssignVnfTest method invalidServiceJsonContentWhenPrepareCDSBean_flowExIsThrown.
@Test
public void invalidServiceJsonContentWhenPrepareCDSBean_flowExIsThrown() throws Exception {
// given
BuildingBlockExecution buildingBlockExecution = createBuildingBlockExecution("{invalidJsonContent}");
prepareExtractPojosForBB(buildingBlockExecution);
// when
testedObject.preProcessAbstractCDSProcessing(buildingBlockExecution);
// then
verify(exceptionBuilderMock).buildAndThrowWorkflowException(eq(buildingBlockExecution), eq(7000), any(IOException.class));
}
use of org.onap.so.bpmn.common.BuildingBlockExecution in project so by onap.
the class ConfigAssignVnfTest method vnfIsNotFoundWhenPrepareCDSBean_flowExIsThrown.
@Test
public void vnfIsNotFoundWhenPrepareCDSBean_flowExIsThrown() throws Exception {
// given
BuildingBlockExecution buildingBlockExecution = createBuildingBlockExecution(createService(Collections.emptyList()));
prepareExtractPojosForBB(buildingBlockExecution);
// when
testedObject.preProcessAbstractCDSProcessing(buildingBlockExecution);
// then
verify(exceptionBuilderMock).buildAndThrowWorkflowException(eq(buildingBlockExecution), eq(7000), any(VnfNotFoundException.class));
}
use of org.onap.so.bpmn.common.BuildingBlockExecution in project so by onap.
the class ConfigAssignVnfTest method prepareAbstractCDSPropertiesBean_success.
@Test
public void prepareAbstractCDSPropertiesBean_success() throws Exception {
// given
BuildingBlockExecution buildingBlockExecution = createBuildingBlockExecution(createService(createVnfList()));
prepareExtractPojosForBB(buildingBlockExecution);
// when
testedObject.preProcessAbstractCDSProcessing(buildingBlockExecution);
// then
verifyConfigAssignPropertiesJsonContent(buildingBlockExecution);
}
use of org.onap.so.bpmn.common.BuildingBlockExecution in project so by onap.
the class AppcRunTasksTest method mapRollbackVariablesTest.
@Test
public void mapRollbackVariablesTest() {
BuildingBlockExecution mock = mock(BuildingBlockExecution.class);
appcRunTasks.mapRollbackVariables(mock, Action.Lock, "1");
verify(mock, times(0)).setVariable(any(String.class), any());
appcRunTasks.mapRollbackVariables(mock, Action.Lock, "0");
verify(mock, times(1)).setVariable("rollbackVnfLock", true);
appcRunTasks.mapRollbackVariables(mock, Action.Unlock, "0");
verify(mock, times(1)).setVariable("rollbackVnfLock", false);
appcRunTasks.mapRollbackVariables(mock, Action.Start, "0");
verify(mock, times(1)).setVariable("rollbackVnfStop", false);
appcRunTasks.mapRollbackVariables(mock, Action.Stop, "0");
verify(mock, times(1)).setVariable("rollbackVnfStop", true);
appcRunTasks.mapRollbackVariables(mock, Action.QuiesceTraffic, "0");
verify(mock, times(1)).setVariable("rollbackQuiesceTraffic", true);
appcRunTasks.mapRollbackVariables(mock, Action.ResumeTraffic, "0");
verify(mock, times(1)).setVariable("rollbackQuiesceTraffic", false);
}
Aggregations