Search in sources :

Example 21 with DelegateExecutionFake

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

the class AAICommonTasksTest method setup.

@Before
public void setup() {
    serviceInstance = new ServiceInstance();
    buildingBlockExecution = new DelegateExecutionImpl(new DelegateExecutionFake());
}
Also used : DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) Before(org.junit.Before)

Example 22 with DelegateExecutionFake

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

the class ExecuteActivityTest method before.

@Before
public void before() throws Exception {
    execution = new DelegateExecutionFake();
    execution.setVariable("vnfType", "testVnfType");
    execution.setVariable("requestAction", "testRequestAction");
    execution.setVariable("mso-request-id", "testMsoRequestId");
    execution.setVariable("vnfId", "testVnfId");
    execution.setVariable("serviceInstanceId", "testServiceInstanceId");
    String bpmnRequest = new String(Files.readAllBytes(Paths.get("src/test/resources/__files/Macro/ServiceMacroAssign.json")));
    execution.setVariable("bpmnRequest", bpmnRequest);
}
Also used : DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) Before(org.junit.Before)

Example 23 with DelegateExecutionFake

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

the class WorkflowValidatorRunnerTest method testValidate.

@Test
public void testValidate() {
    DelegateExecution execution = 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.WorkflowPreValidatorTwo: my-error-two\norg.onap.so.bpmn.common.listener.validation.WorkflowPreValidatorOne: my-error-one", workflowException.getErrorMessage());
    }
    runner.preValidate("test2", mock(DelegateExecution.class));
}
Also used : WorkflowException(org.onap.so.bpmn.core.WorkflowException) DelegateExecution(org.camunda.bpm.engine.delegate.DelegateExecution) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) BpmnError(org.camunda.bpm.engine.delegate.BpmnError) Test(org.junit.Test)

Example 24 with DelegateExecutionFake

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

the class DelegateExecutionImplTest method getGeneralBuildingBlockCastException.

@Test
public void getGeneralBuildingBlockCastException() {
    final Map<String, Serializable> map = new HashMap<>();
    map.put("gBBInput", new DelegateExecutionFake());
    final DelegateExecutionImpl impl = create(map);
    thrown.expect(MalformedBuildingBlockInputException.class);
    impl.getGeneralBuildingBlock();
}
Also used : Serializable(java.io.Serializable) HashMap(java.util.HashMap) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) Test(org.junit.Test)

Example 25 with DelegateExecutionFake

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

the class CreateRelationTest method setUp.

@Before
public void setUp() {
    executionFake = new DelegateExecutionFake();
    executionFake.setVariable("serviceInstanceId", SERVICE_INSTANCE_ID);
    executionFake.setVariable("pnfCorrelationId", PNF_NAME);
}
Also used : DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) Before(org.junit.Before)

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