Search in sources :

Example 1 with DelegateExecutionFake

use of org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake in project so by onap.

the class BuildingBlockValidatorRunnerTest method testValidate.

@Test
public void testValidate() {
    BuildingBlockExecution execution = new DelegateExecutionImpl(new DelegateExecutionFake());
    execution.setVariable("testProcessKey", "1234");
    try {
        runner.preValidate("test", execution);
        fail("exception not thrown");
    } catch (BpmnError e) {
        WorkflowException workflowException = (WorkflowException) execution.getVariable("WorkflowException");
        assertEquals("Failed Validations:\norg.onap.so.bpmn.common.listener.validation.MyPreValidatorTwo: my-error-two\norg.onap.so.bpmn.common.listener.validation.MyPreValidatorOne: my-error-one", workflowException.getErrorMessage());
    }
    runner.preValidate("test2", mock(BuildingBlockExecution.class));
}
Also used : BuildingBlockExecution(org.onap.so.bpmn.common.BuildingBlockExecution) DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) WorkflowException(org.onap.so.bpmn.core.WorkflowException) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) BpmnError(org.camunda.bpm.engine.delegate.BpmnError) Test(org.junit.Test)

Example 2 with DelegateExecutionFake

use of org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake in project so by onap.

the class AbstractVnfCDSRequestProviderTest method createBuildingBlockExecution.

protected BuildingBlockExecution createBuildingBlockExecution() {
    DelegateExecution execution = new DelegateExecutionFake();
    execution.setVariable(GENERAL_BLOCK_EXECUTION_MAP_KEY, createGeneralBuildingBlock());
    return new DelegateExecutionImpl(execution);
}
Also used : DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) DelegateExecution(org.camunda.bpm.engine.delegate.DelegateExecution) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake)

Example 3 with DelegateExecutionFake

use of org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake in project so by onap.

the class ConfigAssignVnfTest method createBuildingBlockExecution.

private BuildingBlockExecution createBuildingBlockExecution(Object serviceJson) {
    DelegateExecution execution = new DelegateExecutionFake();
    execution.setVariable(GENERAL_BLOCK_EXECUTION_MAP_KEY, createGeneralBuildingBlock(serviceJson));
    return new DelegateExecutionImpl(execution);
}
Also used : DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) DelegateExecution(org.camunda.bpm.engine.delegate.DelegateExecution) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake)

Example 4 with DelegateExecutionFake

use of org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake in project so by onap.

the class GenericCDSProcessingBBTest method createBuildingBlockExecution.

private BuildingBlockExecution createBuildingBlockExecution() {
    DelegateExecution execution = new DelegateExecutionFake();
    execution.setVariable(GENERAL_BLOCK_EXECUTION_MAP_KEY, createGeneralBuildingBlock());
    return new DelegateExecutionImpl(execution);
}
Also used : DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) DelegateExecution(org.camunda.bpm.engine.delegate.DelegateExecution) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake)

Example 5 with DelegateExecutionFake

use of org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake in project so by onap.

the class PrepareSdncUpgradePreCheckPnfBBTest method prepareBuildingBlockExecution.

private BuildingBlockExecution prepareBuildingBlockExecution(String payload) {
    DelegateExecution execution = new DelegateExecutionFake();
    execution.setVariable("payload", payload);
    return new DelegateExecutionImpl(execution);
}
Also used : DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) DelegateExecution(org.camunda.bpm.engine.delegate.DelegateExecution) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake)

Aggregations

DelegateExecutionFake (org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake)35 DelegateExecutionImpl (org.onap.so.bpmn.common.DelegateExecutionImpl)17 Before (org.junit.Before)15 DelegateExecution (org.camunda.bpm.engine.delegate.DelegateExecution)12 Test (org.junit.Test)11 BuildingBlockExecution (org.onap.so.bpmn.common.BuildingBlockExecution)7 WorkflowException (org.onap.so.bpmn.core.WorkflowException)3 BpmnError (org.camunda.bpm.engine.delegate.BpmnError)2 ServiceInstance (org.onap.aai.domain.yang.ServiceInstance)2 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)2 ExecuteBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock)2 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)2 RequestContext (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext)2 BBInputSetup (org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup)2 BBInputSetupUtils (org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils)2 CatalogDbClient (org.onap.so.db.catalog.client.CatalogDbClient)2 Serializable (java.io.Serializable)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Customer (org.onap.so.bpmn.servicedecomposition.bbobjects.Customer)1