diff --git a/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn b/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn index 86cc6e0d..62e3f627 100644 --- a/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-configuration-employment-et_englandwales.dmn @@ -14,9 +14,7 @@ then taskAttributes.taskType else if(taskType != null) then taskType - else - null - + else null @@ -640,16 +638,16 @@ else "" "ReviewReferralAdmin", "ReviewReferralJudiciary", -"ReviewReferralLegalOps", -"ReviewReferralResponseAdmin", -"ReviewReferralResponseJudiciary", -"ReviewReferralResponseLegalOps" +"ReviewReferralLegalOps" "majorPriority" - if caseData != null and caseData.referralCollection != null and count(caseData.referralCollection) > 0 and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" + if caseData != null +and caseData.referralCollection != null +and count(caseData.referralCollection) > 0 +and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" then 1000 else 5000 @@ -657,6 +655,30 @@ else 5000 true + + + + + + "ReviewReferralResponseAdmin", +"ReviewReferralResponseJudiciary", +"ReviewReferralResponseLegalOps" + + + "majorPriority" + + + if caseData!=null +and caseData.referralCollection!=null +and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 +and (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" +then 1000 +else 5000 + + + true + + @@ -694,16 +716,16 @@ else 5000 "ReviewReferralAdmin", "ReviewReferralJudiciary", -"ReviewReferralLegalOps", -"ReviewReferralResponseAdmin", -"ReviewReferralResponseJudiciary", -"ReviewReferralResponseLegalOps" +"ReviewReferralLegalOps" "minorPriority" - if caseData != null and caseData.referralCollection != null and count(caseData.referralCollection) > 0 and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" + if caseData != null +and caseData.referralCollection != null +and count(caseData.referralCollection) > 0 +and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" then 100 else 500 @@ -711,6 +733,30 @@ else 500 true + + + + + + "ReviewReferralResponseAdmin", +"ReviewReferralResponseJudiciary", +"ReviewReferralResponseLegalOps" + + + "minorPriority" + + + if caseData!=null +and caseData.referralCollection!=null +and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 +and (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" +then 100 +else 500 + + + true + + @@ -837,16 +883,16 @@ else 500 "ReviewReferralAdmin", "ReviewReferralJudiciary", -"ReviewReferralLegalOps", -"ReviewReferralResponseAdmin", -"ReviewReferralResponseJudiciary", -"ReviewReferralResponseLegalOps" +"ReviewReferralLegalOps" "dueDateIntervalDays" - if caseData != null and caseData.referralCollection != null and count(caseData.referralCollection) > 0 and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" + if caseData != null +and caseData.referralCollection != null +and count(caseData.referralCollection) > 0 +and (reverse(caseData.referralCollection)[1]).value.isUrgent = "Yes" then 1 else 2 @@ -854,6 +900,30 @@ else 2 true + + + + + + "ReviewReferralResponseAdmin", +"ReviewReferralResponseJudiciary", +"ReviewReferralResponseLegalOps" + + + "dueDateIntervalDays" + + + if caseData!=null +and caseData.referralCollection!=null +and count(caseData.referralCollection[count(value.referralReplyCollection)>0])>0 +and (reverse((reverse(caseData.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.isUrgentReply= "Yes" +then 1 +else 2 + + + + + @@ -974,4 +1044,4 @@ else 2 - \ No newline at end of file + diff --git a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn index 7ca23c82..22f1af3e 100644 --- a/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn +++ b/src/main/resources/wa-task-initiation-employment-et_englandwales.dmn @@ -14,31 +14,49 @@ - - if(additionalData != null and additionalData.Data != null and additionalData.Data.referCaseTo != null) - then additionalData.Data.referCaseTo - else null - + if(additionalData!=null +and additionalData.Data!=null +and additionalData.Data.referralCollection!=null +and count(additionalData.Data.referralCollection) > 0) +then (reverse(additionalData.Data.referralCollection)[1]).value.referCaseTo +else null - if(additionalData != null and additionalData.Data != null and additionalData.Data.referralSubject != null) - then additionalData.Data.referralSubject - else null + if(additionalData!=null +and additionalData.Data!=null +and additionalData.Data.referralCollection!=null +and count(additionalData.Data.referralCollection) > 0) +then (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject +else null + + + + + if(additionalData!=null +and additionalData.Data!=null +and additionalData.Data.referralCollection!=null +and count(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])>0) +then (reverse((reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralReplyCollection)[1]).value.directionTo +else null - if(additionalData != null and additionalData.Data != null and additionalData.Data.et3Rule26 != null) - then additionalData.Data.et3Rule26 - else null + if(additionalData != null +and additionalData.Data != null +and additionalData.Data.et3Rule26 != null) +then additionalData.Data.et3Rule26 +else null - if(additionalData!=null and additionalData.Data!=null and additionalData.Data.genericTseApplicationCollection!=null and -count(additionalData.Data.genericTseApplicationCollection) > 0) + if(additionalData!=null +and additionalData.Data!=null +and additionalData.Data.genericTseApplicationCollection!=null +and count(additionalData.Data.genericTseApplicationCollection) > 0) then (reverse(additionalData.Data.genericTseApplicationCollection)[1]).value.type else null @@ -48,10 +66,7 @@ else null if (additionalData!=null and additionalData.Data!=null and additionalData.Data.genericTseApplicationCollection!=null -and count(additionalData.Data.genericTseApplicationCollection[ - value.type="Change personal details" - and (reverse(value.respondCollection)[1]).value.from = "Claimant" - ]) > 0) +and count(additionalData.Data.genericTseApplicationCollection[value.type="Change personal details" and (reverse(value.respondCollection)[1]).value.from = "Claimant"]) > 0) then "Change personal details" else "Other" @@ -61,10 +76,7 @@ else "Other" if (additionalData!=null and additionalData.Data!=null and additionalData.Data.genericTseApplicationCollection!=null -and count(additionalData.Data.genericTseApplicationCollection[ - value.type="Change my personal details" - and (reverse(value.respondCollection)[1]).value.from = "Respondent" - ]) > 0) +and count(additionalData.Data.genericTseApplicationCollection[value.type="Change my personal details" and (reverse(value.respondCollection)[1]).value.from = "Respondent"]) > 0) then "Change my personal details" else "Other" @@ -86,6 +98,9 @@ else "Other" + + + @@ -124,6 +139,9 @@ else "Other" + + + @@ -140,7 +158,8 @@ else "Other" "ReviewReferralAdmin" - "Review Referral - " + additionalData.Data.referralSubject + "Review Referral - " ++ (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -149,6 +168,88 @@ else "Other" "Vetting" + + + "createReferral" + + + + + + "Admin" + + + "Hearings" + + + + + + + + + + + + + + + + + + "IssuePostHearingDirection" + + + "Issue Post Hearing Direction" + + + + + + "Hearing" + + + + + "createReferral" + + + "Accepted" + + + "Admin" + + + "Judgment" + + + + + + + + + + + + + + + + + + "IssueJudgment" + + + "Issue Judgment" + + + + + + "Hearing" + + "createReferral" @@ -162,6 +263,9 @@ else "Other" + + + @@ -178,7 +282,8 @@ else "Other" "ReviewReferralJudiciary" - "Review Referral - " + additionalData.Data.referralSubject + "Review Referral - " ++ (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -187,6 +292,47 @@ else "Other" "Vetting" + + + "createReferral" + + + "Accepted" + + + "Judge" + + + "Rule 21" + + + + + + + + + + + + + + + + + + "DraftAndSignJudgment" + + + "Draft And Sign Judgment" + + + + + + "Judgment" + + "createReferral" @@ -200,6 +346,9 @@ else "Other" + + + @@ -216,7 +365,8 @@ else "Other" "ReviewReferralLegalOps" - "Review Referral - " + additionalData.Data.referralSubject + "Review Referral - " ++ (reverse(additionalData.Data.referralCollection)[1]).value.referralSubject @@ -225,6 +375,135 @@ else "Other" "Vetting" + + + "replyToReferral" + + + "Submitted" + + + + + + + + + "Admin" + + + + + + + + + + + + + + + "ReviewReferralResponseAdmin" + + + "Review Referral Response - " ++ (reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralSubject + + + + + + + "processing" + + + + + "replyToReferral" + + + "Submitted" + + + + + + + + + "Judge" + + + + + + + + + + + + + + + "ReviewReferralResponseJudiciary" + + + "Review Referral Response - " ++ (reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralSubject + + + + + + + "processing" + + + + + "replyToReferral" + + + "Accepted" + + + + + + + + + "Legal officer" + + + + + + + + + + + + + + + "ReviewReferralResponseLegalOps" + + + "Review Referral Response - " ++ (reverse(additionalData.Data.referralCollection[count(value.referralReplyCollection)>0])[1]).value.referralSubject + + + + + + + "processing" + + "et3Response" @@ -238,6 +517,9 @@ else "Other" + + + @@ -273,7 +555,10 @@ else "Other" - + + + + @@ -314,6 +599,9 @@ else "Other" + + + @@ -352,6 +640,9 @@ else "Other" + + + @@ -377,44 +668,6 @@ else "Other" "Vetting" - - - "replyToReferral" - - - "Submitted" - - - "Admin" - - - - - - - - - - - - - - - - - - "ReviewReferralResponseAdmin" - - - "Review Referral Response - " + additionalData.Data.referralSubject - - - - - - "processing" - - "updateHearing" @@ -428,6 +681,9 @@ else "Other" + + + @@ -453,158 +709,6 @@ else "Other" "Judgment" - - - "createReferral" - - - "Accepted" - - - "Judge" - - - "Rule 21" - - - - - - - - - - - - - - - "DraftAndSignJudgment" - - - "Draft And Sign Judgment" - - - - - - "Judgment" - - - - - "createReferral" - - - - - - "Admin" - - - "Hearings" - - - - - - - - - - - - - - - "IssuePostHearingDirection" - - - "Issue Post Hearing Direction" - - - - - - "Hearing" - - - - - "replyToReferral" - - - "Submitted" - - - "Judge" - - - - - - - - - - - - - - - - - - "ReviewReferralResponseJudiciary" - - - "Review Referral Response - " + additionalData.Data.referralSubject - - - - - - "processing" - - - - - "replyToReferral" - - - "Accepted" - - - "Legal officer" - - - - - - - - - - - - - - - - - - "ReviewReferralResponseLegalOps" - - - "Review Referral Response - " + additionalData.Data.referralSubject - - - - - - "processing" - - "et3Response" @@ -618,6 +722,9 @@ else "Other" + + + @@ -643,44 +750,6 @@ else "Other" "processing" - - - "createReferral" - - - "Accepted" - - - "Admin" - - - "Judgment" - - - - - - - - - - - - - - - "IssueJudgment" - - - "Issue Judgment" - - - - - - "Hearing" - - "et3Vetting" @@ -694,6 +763,9 @@ else "Other" + + + "Yes" @@ -732,6 +804,9 @@ else "Other" + + + @@ -770,6 +845,9 @@ else "Other" + + + @@ -818,6 +896,9 @@ else "Other" + + + @@ -856,6 +937,9 @@ else "Other" + + + @@ -904,6 +988,9 @@ else "Other" + + + @@ -942,6 +1029,9 @@ else "Other" + + + @@ -980,6 +1070,9 @@ else "Other" + + + @@ -1018,6 +1111,9 @@ else "Other" + + + @@ -1056,6 +1152,9 @@ else "Other" + + + @@ -1094,6 +1193,9 @@ else "Other" + + + diff --git a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java index 2b7817ee..99da2b9b 100644 --- a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java +++ b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskConfigurationTest.java @@ -39,8 +39,17 @@ class EmploymentTaskConfigurationTest extends DmnDecisionTableBaseUnitTest { private static final String EXTRA_TEST_CALENDAR = "https://raw.githubusercontent.com/hmcts/" + "civil-wa-task-configuration/master/src/main/resources/privilege-calendar.json"; - public static final String IS_URGENT = "{\"referralCollection\":[{\"value\": {\"isUrgent\": \"Yes\"}}]}"; - public static final String NOT_URGENT = "{\"referralCollection\":[{\"value\": {\"isUrgent\": \"No\"}}]}"; + public static final String IS_URGENT = + "{\"referralCollection\":[{\"value\": {\"isUrgent\": \"Yes\"}}]}"; + public static final String NOT_URGENT = + "{\"referralCollection\":[{\"value\": {\"isUrgent\": \"No\"}}]}"; + + public static final String ISURGENT_REPLY_YES = + "{\"referralCollection\":[{\"value\": {\"referralReplyCollection\":" + + "[{\"value\": {\"isUrgentReply\": \"Yes\"}}]}}]}"; + public static final String ISURGENT_REPLY_NO = + "{\"referralCollection\":[{\"value\": {\"referralReplyCollection\":" + + "[{\"value\": {\"isUrgentReply\": \"No\"}}]}}]}"; @BeforeAll public static void initialization() { @@ -185,6 +194,7 @@ public static Stream workType_ScenarioProvider() { Arguments.of("IssuePostHearingDirection", hearingWork), Arguments.of("IssueJudgment", hearingWork), + Arguments.of("ContactTribunalWithAnApplication", applications), Arguments.of("AmendPartyDetails", applications), Arguments.of("WithdrawAllOrPartOfCase", applications), @@ -618,28 +628,28 @@ public static Stream priority_ScenarioProvider() { Arguments.of("ReviewReferralAdmin", IS_URGENT, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), - Arguments.of("ReviewReferralResponseAdmin", IS_URGENT, + Arguments.of("ReviewReferralResponseAdmin", ISURGENT_REPLY_YES, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), Arguments.of("ReviewReferralJudiciary", IS_URGENT, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), - Arguments.of("ReviewReferralResponseJudiciary", IS_URGENT, + Arguments.of("ReviewReferralResponseJudiciary", ISURGENT_REPLY_YES, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), Arguments.of("ReviewReferralLegalOps", IS_URGENT, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), - Arguments.of("ReviewReferralResponseLegalOps", IS_URGENT, + Arguments.of("ReviewReferralResponseLegalOps", ISURGENT_REPLY_YES, dueDateIntervalDays1, urgentMajorPriority, urgentMinorPriority), Arguments.of("ReviewReferralAdmin", NOT_URGENT, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority), - Arguments.of("ReviewReferralResponseAdmin", NOT_URGENT, + Arguments.of("ReviewReferralResponseAdmin", ISURGENT_REPLY_NO, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority), Arguments.of("ReviewReferralJudiciary", NOT_URGENT, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority), - Arguments.of("ReviewReferralResponseJudiciary", NOT_URGENT, + Arguments.of("ReviewReferralResponseJudiciary", ISURGENT_REPLY_NO, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority), Arguments.of("ReviewReferralLegalOps", NOT_URGENT, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority), - Arguments.of("ReviewReferralResponseLegalOps", NOT_URGENT, + Arguments.of("ReviewReferralResponseLegalOps", ISURGENT_REPLY_NO, dueDateIntervalDays2, defaultMajorPriority, defaultMinorPriority) ); } @@ -735,7 +745,7 @@ void if_this_test_fails_needs_updating_with_your_changes() { //The purpose of this test is to prevent adding new rows without being tested DmnDecisionTableImpl logic = (DmnDecisionTableImpl) decision.getDecisionLogic(); - assertThat(logic.getRules().size(), is(48)); + assertThat(logic.getRules().size(), is(51)); } private static Map mapData(String source) { diff --git a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java index 0e44723f..281db184 100644 --- a/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java +++ b/src/test/java/uk/gov/hmcts/et/taskconfiguration/dmn/EmploymentTaskInitiationTest.java @@ -25,16 +25,6 @@ class EmploymentTaskInitiationTest extends DmnDecisionTableBaseUnitTest { - public static final String REFERCASETO_ADMIN = "\"referCaseTo\":\"Admin\""; - public static final String REFERCASETO_JUDGE = "\"referCaseTo\":\"Judge\""; - public static final String REFERCASETO_LEGALOFFICER = "\"referCaseTo\":\"Legal officer\""; - - public static final String REFERRAL_SUBJECT = "\"referralSubject\":\"(Referral Subject)\""; - public static final String REFERRAL_RULE21 = "\"referralSubject\":\"Rule 21\""; - public static final String REFERRAL_HEARINGS = "\"referralSubject\":\"Hearings\""; - public static final String REFERRAL_JUDGMENT = "\"referralSubject\":\"Judgment\""; - - public static final String ISURGENT_YES = "\"isUrgent\":\"Yes\""; public static final String RULE26_YES = "\"et3Rule26\":\"Yes\""; public static final String APPLICATION_COLLECTION = @@ -64,6 +54,33 @@ class EmploymentTaskInitiationTest extends DmnDecisionTableBaseUnitTest { public static final String CLAIMANT_WITHDRAW_ALL_OR_PART_OF_CASE = createApplications("Strike out all/part of response", "Claimant"); + public static final String REFERRAL_COLLECTION = + "\"referralCollection\":[{\"value\": " + + "{\"referralSubject\": \"%s\",\"referCaseTo\": \"%s\",\"isUrgent\": \"%s\"%s}" + + "}]"; + public static final String REFERRALREPLY_COLLECTION = + ",\"referralReplyCollection\": [{\"value\": {\"directionTo\": \"%s\",\"isUrgentReply\": \"%s\"}}]"; + + public static final String REFERRAL_ADMIN = + createReferrals("(Referral Subject)", "Admin", "Yes", "", ""); + public static final String REFERRAL_ADMIN_HEARING = + createReferrals("Hearings", "Admin", "Yes", "", ""); + public static final String REFERRAL_ADMIN_JUDGMENT = + createReferrals("Judgment", "Admin", "Yes", "", ""); + public static final String REFERRAL_JUDGE = + createReferrals("(Referral Subject)", "Judge", "Yes", "", ""); + public static final String REFERRAL_JUDGE_RULE21 = + createReferrals("Rule 21", "Judge", "Yes", "", ""); + public static final String REFERRAL_LEGALOFFICER = + createReferrals("(Referral Subject)", "Legal officer", "Yes", "", ""); + + public static final String REFERRAL_REPLY_ADMIN = + createReferrals("(Referral Subject)", "", "", "Admin", "Yes"); + public static final String REFERRAL_REPLY_JUDGE = + createReferrals("Rule 21", "", "", "Judge", "Yes"); + public static final String REFERRAL_REPLY_LEGALOFFICER = + createReferrals("(Referral Subject)", "", "", "Legal officer", "Yes"); + @BeforeAll public static void initialization() { CURRENT_DMN_DECISION_TABLE = DmnDecisionTable.WA_TASK_INITIATION_ET_EW; @@ -86,13 +103,7 @@ public static Stream scenarioProvider() { Arguments.of( "createReferral", "Submitted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + REFERRAL_ADMIN + "}}"), List.of( mapExpectedOutput( "ReviewReferralAdmin", @@ -101,16 +112,34 @@ public static Stream scenarioProvider() { ) ) ), + Arguments.of( + "createReferral", + null, + mapAdditionalData("{\"Data\":{" + REFERRAL_ADMIN_HEARING + "}}"), + List.of( + mapExpectedOutput( + "IssuePostHearingDirection", + "Issue Post Hearing Direction", + "Hearing" + ) + ) + ), + Arguments.of( + "createReferral", + "Accepted", + mapAdditionalData("{\"Data\":{" + REFERRAL_ADMIN_JUDGMENT + "}}"), + List.of( + mapExpectedOutput( + "IssueJudgment", + "Issue Judgment", + "Hearing" + ) + ) + ), Arguments.of( "createReferral", "Submitted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + REFERCASETO_JUDGE + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + REFERRAL_JUDGE + "}}"), List.of( mapExpectedOutput( "ReviewReferralJudiciary", @@ -119,16 +148,22 @@ public static Stream scenarioProvider() { ) ) ), + Arguments.of( + "createReferral", + "Accepted", + mapAdditionalData("{\"Data\":{" + REFERRAL_JUDGE_RULE21 + "}}"), + List.of( + mapExpectedOutput( + "DraftAndSignJudgment", + "Draft And Sign Judgment", + "Judgment" + ) + ) + ), Arguments.of( "createReferral", "Submitted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + REFERCASETO_LEGALOFFICER + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + REFERRAL_LEGALOFFICER + "}}"), List.of( mapExpectedOutput( "ReviewReferralLegalOps", @@ -137,6 +172,42 @@ public static Stream scenarioProvider() { ) ) ), + Arguments.of( + "replyToReferral", + "Submitted", + mapAdditionalData("{\"Data\":{" + REFERRAL_REPLY_ADMIN + "}}"), + List.of( + mapExpectedOutput( + "ReviewReferralResponseAdmin", + "Review Referral Response - (Referral Subject)", + "processing" + ) + ) + ), + Arguments.of( + "replyToReferral", + "Submitted", + mapAdditionalData("{\"Data\":{" + REFERRAL_REPLY_JUDGE + "}}"), + List.of( + mapExpectedOutput( + "ReviewReferralResponseJudiciary", + "Review Referral Response - Rule 21", + "processing" + ) + ) + ), + Arguments.of( + "replyToReferral", + "Accepted", + mapAdditionalData("{\"Data\":{" + REFERRAL_REPLY_LEGALOFFICER + "}}"), + List.of( + mapExpectedOutput( + "ReviewReferralResponseLegalOps", + "Review Referral Response - (Referral Subject)", + "processing" + ) + ) + ), Arguments.of( "et3Response", "Accepted", @@ -195,24 +266,6 @@ public static Stream scenarioProvider() { ) ) ), - Arguments.of( - "replyToReferral", - "Submitted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }" - + "}"), - List.of( - mapExpectedOutput( - "ReviewReferralResponseAdmin", - "Review Referral Response - (Referral Subject)", - "processing" - ) - ) - ), Arguments.of( "updateHearing", "Accepted", @@ -225,102 +278,10 @@ public static Stream scenarioProvider() { ) ) ), - Arguments.of( - "createReferral", - "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + REFERCASETO_JUDGE + "," - + REFERRAL_RULE21 + "," - + ISURGENT_YES - + " }" - + "}"), - List.of( - mapExpectedOutput( - "DraftAndSignJudgment", - "Draft And Sign Judgment", - "Judgment" - ) - ) - ), - Arguments.of( - "createReferral", - null, - mapAdditionalData("{\n" - + " \"Data\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_HEARINGS - + " }" - + "}"), - List.of( - mapExpectedOutput( - "IssuePostHearingDirection", - "Issue Post Hearing Direction", - "Hearing" - ) - ) - ), - Arguments.of( - "replyToReferral", - "Submitted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + REFERCASETO_JUDGE + "," - + REFERRAL_RULE21 + "," - + ISURGENT_YES - + " }" - + "}"), - List.of( - mapExpectedOutput( - "ReviewReferralResponseJudiciary", - "Review Referral Response - Rule 21", - "processing" - ) - ) - ), - Arguments.of( - "replyToReferral", - "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + REFERCASETO_LEGALOFFICER + "," - + REFERRAL_SUBJECT + "," - + ISURGENT_YES - + " }" - + "}"), - List.of( - mapExpectedOutput( - "ReviewReferralResponseLegalOps", - "Review Referral Response - (Referral Subject)", - "processing" - ) - ) - ), - Arguments.of( - "createReferral", - "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + REFERCASETO_ADMIN + "," - + REFERRAL_JUDGMENT - + " }" - + "}"), - List.of( - mapExpectedOutput( - "IssueJudgment", - "Issue Judgment", - "Hearing" - ) - ) - ), Arguments.of( "et3Vetting", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + RULE26_YES - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + RULE26_YES + "}}"), List.of( mapExpectedOutput( "CompleteInitialConsideration", @@ -337,11 +298,7 @@ public static Stream scenarioProvider() { Arguments.of( "SUBMIT_CLAIMANT_TSE", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + SUBMISSION_REASON_CLAIMANT_AMEND - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + SUBMISSION_REASON_CLAIMANT_AMEND + "}}"), List.of( mapExpectedOutput( "ContactTribunalWithAnApplication", @@ -353,11 +310,7 @@ public static Stream scenarioProvider() { Arguments.of( "CLAIMANT_TSE_RESPOND", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + CLAIMANT_RESPONDING_TO_RESPONDENT_AMEND - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + CLAIMANT_RESPONDING_TO_RESPONDENT_AMEND + "}}"), List.of( mapExpectedOutput( "ContactTribunalWithAnApplication", @@ -369,11 +322,7 @@ public static Stream scenarioProvider() { Arguments.of( "respondentTSE", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + SUBMISSION_REASON_RESPONDENT_AMEND - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + SUBMISSION_REASON_RESPONDENT_AMEND + "}}"), List.of( mapExpectedOutput( "ContactTribunalWithAnApplication", @@ -385,11 +334,7 @@ public static Stream scenarioProvider() { Arguments.of( "tseRespond", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + RESPONDENT_RESPONDING_TO_CLAIMANT_AMEND - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + RESPONDENT_RESPONDING_TO_CLAIMANT_AMEND + "}}"), List.of( mapExpectedOutput( "ContactTribunalWithAnApplication", @@ -401,11 +346,7 @@ public static Stream scenarioProvider() { Arguments.of( "SUBMIT_CLAIMANT_TSE", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + SUBMISSION_REASON_CLAIMANT_PERSONALDETAILS - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + SUBMISSION_REASON_CLAIMANT_PERSONALDETAILS + "}}"), List.of( mapExpectedOutput( "AmendPartyDetails", @@ -417,11 +358,7 @@ public static Stream scenarioProvider() { Arguments.of( "CLAIMANT_TSE_RESPOND", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + CLAIMANT_RESPONDING_TO_RESPONDENT_PERSONALDETAILS - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + CLAIMANT_RESPONDING_TO_RESPONDENT_PERSONALDETAILS + "}}"), List.of( mapExpectedOutput( "AmendPartyDetails", @@ -433,11 +370,7 @@ public static Stream scenarioProvider() { Arguments.of( "respondentTSE", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + SUBMISSION_REASON_RESPONDENT_PERSONALDETAILS - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + SUBMISSION_REASON_RESPONDENT_PERSONALDETAILS + "}}"), List.of( mapExpectedOutput( "AmendPartyDetails", @@ -449,11 +382,7 @@ public static Stream scenarioProvider() { Arguments.of( "tseRespond", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + RESPONDENT_RESPONDING_TO_CLAIMANT_PERSONALDETAILS - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + RESPONDENT_RESPONDING_TO_CLAIMANT_PERSONALDETAILS + "}}"), List.of( mapExpectedOutput( "AmendPartyDetails", @@ -465,11 +394,7 @@ public static Stream scenarioProvider() { Arguments.of( "SUBMIT_CLAIMANT_TSE", "Accepted", - mapAdditionalData("{\n" - + " \"Data\":{\n" - + CLAIMANT_WITHDRAW_ALL_OR_PART_OF_CASE - + " }" - + "}"), + mapAdditionalData("{\"Data\":{" + CLAIMANT_WITHDRAW_ALL_OR_PART_OF_CASE + "}}"), List.of( mapExpectedOutput( "WithdrawAllOrPartOfCase", @@ -521,6 +446,25 @@ private static String createApplications(String appliciationType, String respond return String.format(APPLICATION_COLLECTION, appliciationType, respondCollection); } + private static String createReferrals( + String referralSubject, + String referralReferCaseTo, + String referralUrgency, + String referralDirectionTo, + String referralReplyUrgency) { + + String replyCollection = ""; + if (referralDirectionTo != "") { + replyCollection = String.format(REFERRALREPLY_COLLECTION, referralDirectionTo, referralReplyUrgency); + } + + return String.format(REFERRAL_COLLECTION, + referralSubject, + referralReferCaseTo, + referralUrgency, + replyCollection); + } + private static Map mapAdditionalData(String additionalData) { ObjectMapper mapper = new ObjectMapper(); try {