From 6d9cdb12aee88e8fcc259791b02c86f1a5d3de76 Mon Sep 17 00:00:00 2001 From: sherlynkhaw Date: Tue, 8 Oct 2024 18:16:01 +0100 Subject: [PATCH] CIV-15042: Do not take case offline when pay immediately is done on claimant response (#1106) Co-authored-by: Azam <106387766+Azam-Hmcts@users.noreply.github.com> --- .../camunda/claimant_response_spec.bpmn | 977 +++++++++--------- .../civil/bpmn/ClaimantResponseSpecTest.java | 40 +- 2 files changed, 543 insertions(+), 474 deletions(-) diff --git a/src/main/resources/camunda/claimant_response_spec.bpmn b/src/main/resources/camunda/claimant_response_spec.bpmn index e1fb05826..e50d160b6 100644 --- a/src/main/resources/camunda/claimant_response_spec.bpmn +++ b/src/main/resources/camunda/claimant_response_spec.bpmn @@ -1,5 +1,5 @@ - + Flow_0g2t112 @@ -406,10 +406,10 @@ PROCEEDS_IN_HERITAGE_SYSTEM - Flow_Flow_PAY_IMMEDIATELY + Flow_JO_ONLINE_DISABLED Flow_00f0sau - + ${flowState == "MAIN.FULL_ADMIT_PAY_IMMEDIATELY"} @@ -492,6 +492,7 @@ Flow_0rg51dv Flow_0unqxdq Flow_1dx6rl0 + Flow_JO_ONLINE_ENABLED Flow_189q5fx @@ -523,6 +524,17 @@ ${(!empty flowFlags.UNREPRESENTED_DEFENDANT_ONE && flowFlags.UNREPRESENTED_DEFENDANT_ONE) && (flowState == "MAIN.FULL_DEFENCE_NOT_PROCEED") && (!empty flowFlags.DASHBOARD_SERVICE_ENABLED && flowFlags.DASHBOARD_SERVICE_ENABLED)} + + Flow_Flow_PAY_IMMEDIATELY + Flow_JO_ONLINE_DISABLED + Flow_JO_ONLINE_ENABLED + + + ${!empty flowFlags.JO_ONLINE_LIVE_ENABLED && !flowFlags.JO_ONLINE_LIVE_ENABLED} + + + ${!empty flowFlags.JO_ONLINE_LIVE_ENABLED && flowFlags.JO_ONLINE_LIVE_ENABLED} + 2 Respondent representatives @@ -555,544 +567,599 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - + - - + + + + + + + + + - + - - - - - - - - - - - - - - - + + + + + + - + - - + + - + - - - + + + + + - + - - - + + + + + + - - - + + + - - - - + + + + - - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - + + + - - - + + + - + - - - - - - - - + + + - + - - - - - - + + + + + - - - + + + + + + + + + + + + + - + - - - + + + + - + - - - + + + + - + - - - - - - - - - - + + + + - - - - - + + + + - + - - - - + + + - - - + + + - - - - - + + + - - - + + + + + + + + - + - - - - + + + - + - - - - - - - - + + + + + + + + + - + - - - + + + - + - - - - - - - - + + + + + - - - + + + - - - + + + + - - - - + + + + + - + - - - + + + + + + - - - - + + + - - - - + + + - + - - - - + + + - + - - - - - - - - + + + - + - - - - + + + + + + - - - + + + + + + + - - - - - + + + - - - + + + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + + + + + + + - - - + + + - - - - + + + - - - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + + + - - - - + + + - - - + + + + + - - - + + + + + + + + - + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1109,42 +1176,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ClaimantResponseSpecTest.java b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ClaimantResponseSpecTest.java index 0a67e73af..489d4ab51 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ClaimantResponseSpecTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ClaimantResponseSpecTest.java @@ -115,7 +115,10 @@ void shouldSuccessfullyCompleteWhenPayImmediately() { VariableMap variables = Variables.createVariables(); variables.putValue("flowState", "MAIN.FULL_ADMIT_PAY_IMMEDIATELY"); - variables.putValue("flowFlags", Map.of(DASHBOARD_SERVICE_ENABLED, true)); + variables.putValue("flowFlags", Map.of( + DASHBOARD_SERVICE_ENABLED, true, + JO_ONLINE_LIVE_ENABLED, false + )); //complete the start business process ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC); @@ -155,6 +158,41 @@ void shouldSuccessfullyCompleteWhenPayImmediately() { assertNoExternalTasksLeft(); } + @Test + void shouldSuccessfullyCompleteWhenPayImmediately_JoFlagEnabled() { + //assert process has started + assertFalse(processInstance.isEnded()); + + //assert message start event + assertThat(getProcessDefinitionByMessage("CLAIMANT_RESPONSE_SPEC").getKey()) + .isEqualTo("CLAIMANT_RESPONSE_PROCESS_ID_SPEC"); + + VariableMap variables = Variables.createVariables(); + variables.putValue("flowState", "MAIN.FULL_ADMIT_PAY_IMMEDIATELY"); + variables.putValue("flowFlags", Map.of( + DASHBOARD_SERVICE_ENABLED, true, + JO_ONLINE_LIVE_ENABLED, true + )); + + //complete the start business process + ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC); + assertCompleteExternalTask( + startBusiness, + START_BUSINESS_TOPIC, + START_BUSINESS_EVENT, + START_BUSINESS_ACTIVITY, + variables + ); + + createDefendantDashboardNotification(); + + //end business process + ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS); + completeBusinessProcess(endBusinessProcess); + + assertNoExternalTasksLeft(); + } + @Test void shouldSuccessfullyCompleteClaimantResponseWithQD_WhenApplicantRejectToProceed() { //assert process has started