diff --git a/src/main/resources/camunda/claimant_response_cui.bpmn b/src/main/resources/camunda/claimant_response_cui.bpmn new file mode 100644 index 000000000..3259c89fd --- /dev/null +++ b/src/main/resources/camunda/claimant_response_cui.bpmn @@ -0,0 +1,159 @@ + + + + + Flow_0uwkh9v + + + + Flow_1utmlsv + + + Flow_1uzxrbl + CLRCUI_PART_ADMISSION_NOT_SETTLED_NO_MEDIATION + Flow_14tv10k + + + ${flowState == "MAIN.PART_ADMIT_NOT_SETTLED_NO_MEDIATION"} + + + + + JUDICIAL_REFERRAL + + + CLRCUI_NO_MEDIATION_RULE + Flow_1stajpv + + + CLRCUI_PART_ADMISSION_NOT_SETTLED_NO_MEDIATION + CLRCUI_NO_MEDIATION_RULE + Flow_0mw4pz5 + + + ${!(!empty flowFlags.AGREED_TO_MEDIATION && flowFlags.AGREED_TO_MEDIATION)} + + + Flow_0r584ez + + + + + + + + Flow_0uwkh9v + Flow_1uzxrbl + + + + Flow_0r584ez + + + + + + + + Flow_1stajpv + Flow_14tv10k + Flow_0mw4pz5 + Flow_1utmlsv + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ClaimantResponseCuiTest.java b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ClaimantResponseCuiTest.java new file mode 100644 index 000000000..94954290f --- /dev/null +++ b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ClaimantResponseCuiTest.java @@ -0,0 +1,68 @@ +package uk.gov.hmcts.reform.civil.bpmn; + +import org.camunda.bpm.engine.externaltask.ExternalTask; +import org.camunda.bpm.engine.variable.VariableMap; +import org.camunda.bpm.engine.variable.Variables; +import org.junit.jupiter.api.Test; + +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; + +public class ClaimantResponseCuiTest extends BpmnBaseTest { + + private static final String MESSAGE_NAME = "CLAIMANT_RESPONSE_CUI"; + private static final String PROCESS_ID = "CLAIMANT_RESPONSE_CUI_PROCESS_ID"; + private static final String JUDICIAL_REFERRAL_EVENT = "JUDICIAL_REFERRAL"; + private static final String JUDICIAL_REFERRAL_ACTIVITY_ID = "JudicialReferral"; + + public ClaimantResponseCuiTest() { + super( + "claimant_response_cui.bpmn", + "CLAIMANT_RESPONSE_CUI_PROCESS_ID" + ); + } + + @Test + void shouldRunProcess() { + + //assert process has started + assertFalse(processInstance.isEnded()); + + //assert message start event + assertThat(getProcessDefinitionByMessage(MESSAGE_NAME).getKey()).isEqualTo(PROCESS_ID); + ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC); + VariableMap variables = Variables.createVariables(); + variables.putValue("flowState", "MAIN.PART_ADMIT_NOT_SETTLED_NO_MEDIATION"); + variables.put(FLOW_FLAGS, Map.of( + ONE_RESPONDENT_REPRESENTATIVE, true, + TWO_RESPONDENT_REPRESENTATIVES, false, + GENERAL_APPLICATION_ENABLED, true, + IS_MULTI_TRACK, true + )); + assertCompleteExternalTask( + startBusiness, + START_BUSINESS_TOPIC, + START_BUSINESS_EVENT, + START_BUSINESS_ACTIVITY, + variables + ); + ExternalTask judicialReferral = assertNextExternalTask(PROCESS_CASE_EVENT); + assertCompleteExternalTask( + judicialReferral, + PROCESS_CASE_EVENT, + JUDICIAL_REFERRAL_EVENT, + JUDICIAL_REFERRAL_ACTIVITY_ID, + variables + ); + endBusinessProcess(); + assertNoExternalTasksLeft(); + } + + private void endBusinessProcess() { + ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS); + completeBusinessProcess(endBusinessProcess); + } + +}