Search in sources :

Example 16 with DelegateExecutionFake

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

the class DeleteVfModuleTest method prepareBuildingBlockExecution.

private BuildingBlockExecution prepareBuildingBlockExecution() {
    DelegateExecution execution = new DelegateExecutionFake();
    execution.setVariable("gBBInput", prepareGeneralBuildingBlock());
    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 17 with DelegateExecutionFake

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

the class ServiceLevelUpgradeTest method prepareExecution.

private DelegateExecution prepareExecution() {
    DelegateExecution execution = new DelegateExecutionFake();
    execution.setVariable(ServiceLevelConstants.SERVICE_INSTANCE_ID, "serviceTest");
    execution.setVariable(ServiceLevelConstants.BPMN_REQUEST, "bpmnRequestTest");
    execution.setVariable(ServiceLevelConstants.PNF_NAME, "pnfNameTest");
    return execution;
}
Also used : DelegateExecution(org.camunda.bpm.engine.delegate.DelegateExecution) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake)

Example 18 with DelegateExecutionFake

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

the class HomingListenerTest method runWithHoming.

@Test
public void runWithHoming() {
    // given
    DelegateExecution execution = new DelegateExecutionFake();
    execution.setVariable("homing", true);
    execution.setVariable(CALLED_HOMING, false);
    BuildingBlockExecution buildingBlockExecution = new DelegateExecutionImpl(execution);
    ExecuteBuildingBlock executeBuildingBlock = new ExecuteBuildingBlock();
    // when
    new HomingListener().run(null, executeBuildingBlock, buildingBlockExecution);
    // then
    assertThat(executeBuildingBlock.isHoming()).isTrue();
    assertThat((boolean) buildingBlockExecution.getVariable(CALLED_HOMING)).isTrue();
}
Also used : BuildingBlockExecution(org.onap.so.bpmn.common.BuildingBlockExecution) ExecuteBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock) DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) DelegateExecution(org.camunda.bpm.engine.delegate.DelegateExecution) DelegateExecutionFake(org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake) Test(org.junit.Test)

Example 19 with DelegateExecutionFake

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

the class GeneratePayloadForCdsTest 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 20 with DelegateExecutionFake

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

the class GeneratePayloadForCdsTest method prepareDelegateExecutionObj.

private DelegateExecution prepareDelegateExecutionObj(String scope, String action) {
    DelegateExecution execution = new DelegateExecutionFake();
    execution.setVariable(PROCESS_KEY, TEST_PROCESS_KEY);
    execution.setVariable(PNF_CORRELATION_ID, TEST_PNF_CORRELATION_ID);
    execution.setVariable(MODEL_UUID, TEST_MODEL_UUID);
    execution.setVariable(SERVICE_INSTANCE_ID, TEST_SERVICE_INSTANCE_ID);
    execution.setVariable(MSO_REQUEST_ID, TEST_MSO_REQUEST_ID);
    execution.setVariable(PNF_UUID, TEST_PNF_UUID);
    execution.setVariable(PRC_INSTANCE_NAME, TEST_PNF_RESOURCE_INSTANCE_NAME);
    execution.setVariable(PRC_CUSTOMIZATION_UUID, TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
    execution.setVariable(PRC_TARGET_SOFTWARE_VERSION, TEST_SOFTWARE_VERSION);
    execution.setVariable(PRC_BLUEPRINT_NAME, TEST_PNF_RESOURCE_BLUEPRINT_NAME);
    execution.setVariable(PRC_BLUEPRINT_VERSION, TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
    execution.setVariable(SCOPE, scope);
    execution.setVariable(ACTION, action);
    execution.setVariable("mode", "async");
    return execution;
}
Also used : 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