Search in sources :

Example 6 with DelegateExecutionFake

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

the class SDNCRequestTasksTest method setup.

@Before
public void setup() {
    delegateExecution = new DelegateExecutionFake();
    delegateExecution.setVariable("SDNCRequest", createSDNCRequest());
}
Also used : DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) Before(org.junit.Before)

Example 7 with DelegateExecutionFake

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

the class ManualHandlingTasksTest method before.

@Before
public void before() throws Exception {
    MockitoAnnotations.initMocks(this);
    delegateExecution = new DelegateExecutionFake();
    buildingBlockExecution = new DelegateExecutionImpl(delegateExecution);
    generalBuildingBlock = new GeneralBuildingBlock();
    requestContext = new RequestContext();
    requestContext.setRequestorId("someRequestorId");
    generalBuildingBlock.setRequestContext(requestContext);
    buildingBlockExecution.setVariable("mso-request-id", ("testMsoRequestId"));
    buildingBlockExecution.setVariable("vnfType", "testVnfType");
    buildingBlockExecution.setVariable("gBBInput", generalBuildingBlock);
    buildingBlockExecution.setVariable("rainyDayVnfName", "someVnfName");
    buildingBlockExecution.setVariable("workStep", "someWorkstep");
    buildingBlockExecution.setVariable("taskTimeout", "PT5M");
}
Also used : GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock) DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) Before(org.junit.Before)

Example 8 with DelegateExecutionFake

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

the class ExecuteBuildingBlockRainyDayUnitTest method setup.

@Before
public void setup() {
    exception = new WorkflowException("Test exception", 7000, "", "", ONAPComponents.SDNC);
    noExtSystemErrorSourceException = new WorkflowException("Test exception without extsystemErrorSource", 7000, "", "");
    execution = new DelegateExecutionFake();
    execution.setVariable("mso-request-id", "ef7c004b-829f-4773-a7d8-4de29feef5b1");
    executionNullisRollback = new DelegateExecutionFake();
    executionNullisRollback.setVariable("mso-request-id", "ef7c004b-829f-4773-a7d8-4de29feef5b1");
}
Also used : WorkflowException(org.onap.so.bpmn.core.WorkflowException) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) Before(org.junit.Before)

Example 9 with DelegateExecutionFake

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

the class GeneratePnfUuidDelegateTest method execute_shouldSetValidUuidAsPnfUuid.

@Test
public void execute_shouldSetValidUuidAsPnfUuid() {
    // given
    GeneratePnfUuidDelegate delegate = new GeneratePnfUuidDelegate();
    DelegateExecution execution = new DelegateExecutionFake();
    // when
    delegate.execute(execution);
    // then
    assertThat((String) execution.getVariable(PNF_UUID)).matches(PnfCheckInputs.UUID_REGEX);
}
Also used : DelegateExecution(org.camunda.bpm.engine.delegate.DelegateExecution) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) Test(org.junit.Test)

Example 10 with DelegateExecutionFake

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

the class WorkflowActionBBFailureTest method before.

@Before
public void before() throws Exception {
    execution = new DelegateExecutionFake();
    org.onap.aai.domain.yang.ServiceInstance servInstance = new org.onap.aai.domain.yang.ServiceInstance();
    servInstance.setServiceInstanceId("TEST");
    when(bbSetupUtils.getAAIServiceInstanceByName(anyString(), isA(Customer.class))).thenReturn(servInstance);
    workflowAction.setBbInputSetupUtils(bbSetupUtils);
    workflowAction.setBbInputSetup(bbInputSetup);
}
Also used : Customer(org.onap.so.bpmn.servicedecomposition.bbobjects.Customer) 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