From f46e824fe4730738cc422e87facc5c80ffa44b10 Mon Sep 17 00:00:00 2001 From: Rupali Shirode Date: Mon, 28 Aug 2023 18:39:15 +0530 Subject: [SO] Macro flow for PNF-Modify operation Macro flow for PNF-Modify operation Issue-ID: SO-4111 Change-Id: Ic51cbee5fe59f3aafb2ec41773504b183763d9ec Signed-off-by: Rupali Shirode --- .../so/bpmn/common/AAISetPNFInMaintBBTest.java | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAISetPNFInMaintBBTest.java (limited to 'bpmn/so-bpmn-building-blocks/src/test') diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAISetPNFInMaintBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAISetPNFInMaintBBTest.java new file mode 100644 index 0000000000..4ff568771d --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/common/AAISetPNFInMaintBBTest.java @@ -0,0 +1,32 @@ +package org.onap.so.bpmn.common; + +import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.junit.Test; +import org.onap.so.bpmn.BaseBPMNTest; +import java.io.IOException; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doThrow; + +public class AAISetPNFInMaintBBTest extends BaseBPMNTest { + @Test + public void sunnyDayAAISetPnfInMaintBBTest() throws InterruptedException, IOException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("AAISetPnfInMaintBB", variables); + assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_AAISetPnfInMaintBB", "Task_SetInMaint", + "End_AAISetPnfInMaintBB"); + } + + @Test + public void rainyDayAAISetPnfInMaintBBTest() { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .modifyPnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class)); + + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("AAISetPnfInMaintBB", variables); + assertThat(processInstance).isNotNull(); + assertThat(processInstance).isStarted().hasPassedInOrder("Start_AAISetPnfInMaintBB", "Task_SetInMaint") + .hasNotPassed("End_AAISetPnfInMaintBB"); + assertThat(processInstance).isEnded(); + } + +} -- cgit 1.2.3-korg