Search in sources :

Example 16 with DelegateExecutionImpl

use of org.onap.so.bpmn.common.DelegateExecutionImpl 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 DelegateExecutionImpl

use of org.onap.so.bpmn.common.DelegateExecutionImpl 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 18 with DelegateExecutionImpl

use of org.onap.so.bpmn.common.DelegateExecutionImpl 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 19 with DelegateExecutionImpl

use of org.onap.so.bpmn.common.DelegateExecutionImpl 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 20 with DelegateExecutionImpl

use of org.onap.so.bpmn.common.DelegateExecutionImpl in project so by onap.

the class TestDataSetup method buildingBlockTestDataSetupBefore.

@Before
public void buildingBlockTestDataSetupBefore() {
    collectionCounter = 0;
    configurationCounter = 0;
    customerCounter = 0;
    genericVnfCounter = 0;
    instanceGroupCounter = 0;
    l3NetworkCounter = 0;
    owningEntityCounter = 0;
    pnfCounter = 0;
    projectCounter = 0;
    serviceInstanceCounter = 0;
    serviceProxyCounter = 0;
    serviceSubscriptionCounter = 0;
    vfModuleCounter = 0;
    volumeGroupCounter = 0;
    vpnBindingCounter = 0;
    vpnBondingLinkCounter = 0;
    execution = new DelegateExecutionImpl(new ExecutionImpl());
    execution.setVariable("testProcessKey", "testProcessKeyValue");
    gBBInput = new GeneralBuildingBlock();
    execution.setVariable("gBBInput", gBBInput);
    lookupKeyMap = new HashMap<ResourceKey, String>();
    execution.setVariable("lookupKeyMap", lookupKeyMap);
    ExecutionImpl mockExecutionImpl = mock(ExecutionImpl.class);
    doReturn("test").when(mockExecutionImpl).getProcessInstanceId();
    ExecutionImpl executionImpl = new ExecutionImpl();
    executionImpl.setProcessInstance(mockExecutionImpl);
    delegateExecution = (DelegateExecution) executionImpl;
    delegateExecution.setVariable("testProcessKey", "testProcessKeyValue");
}
Also used : GeneralBuildingBlock(org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock) DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) DelegateExecutionImpl(org.onap.so.bpmn.common.DelegateExecutionImpl) ExecutionImpl(org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl) ResourceKey(org.onap.so.bpmn.servicedecomposition.entities.ResourceKey) Before(org.junit.Before)

Aggregations

DelegateExecutionImpl (org.onap.so.bpmn.common.DelegateExecutionImpl)29 DelegateExecutionFake (org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake)17 BuildingBlockExecution (org.onap.so.bpmn.common.BuildingBlockExecution)11 DelegateExecution (org.camunda.bpm.engine.delegate.DelegateExecution)9 Before (org.junit.Before)9 Test (org.junit.Test)9 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)8 ExecutionImpl (org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl)6 ExecuteBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock)6 ResourceKey (org.onap.so.bpmn.servicedecomposition.entities.ResourceKey)5 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 List (java.util.List)3 EntityNotFoundException (javax.persistence.EntityNotFoundException)3 BpmnError (org.camunda.bpm.engine.delegate.BpmnError)2 WorkflowException (org.onap.so.bpmn.core.WorkflowException)2 BuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock)2 RequestContext (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext)2 ExtractPojosForBB (org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB)2