From 99d0704027f29e20a814e6db569760d1fd9f6e40 Mon Sep 17 00:00:00 2001 From: kannan-v-hmcts <148557022+kannan-v-hmcts@users.noreply.github.com> Date: Wed, 24 Jul 2024 15:46:39 +0100 Subject: [PATCH] CIV-13440 Changing Trial Arrangements Date To 4 weeks Before The Hearing (#5110) * CIV-13440 changing trial arrangements date to 4 weeks before the hearing date * CIV-13440 checkstyle error * CIV-13440 fixing integration tests --- ...ialArrangementsNotificationScenarioTest.java | 17 ++++++++++++++++- ...ialArrangementsNotificationScenarioTest.java | 17 ++++++++++++++++- .../DashboardNotificationsParamsMapper.java | 2 +- .../DashboardNotificationsParamsMapperTest.java | 4 ++++ 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/integrationTest/java/uk/gov/hmcts/reform/civil/controllers/dashboard/scenarios/claimant/ClaimantTrialArrangementsNotificationScenarioTest.java b/src/integrationTest/java/uk/gov/hmcts/reform/civil/controllers/dashboard/scenarios/claimant/ClaimantTrialArrangementsNotificationScenarioTest.java index f198946bd65..d2214d45793 100644 --- a/src/integrationTest/java/uk/gov/hmcts/reform/civil/controllers/dashboard/scenarios/claimant/ClaimantTrialArrangementsNotificationScenarioTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/reform/civil/controllers/dashboard/scenarios/claimant/ClaimantTrialArrangementsNotificationScenarioTest.java @@ -11,6 +11,7 @@ import uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.claimant.TrialArrangementsClaimantNotificationHandler; import uk.gov.hmcts.reform.civil.model.CaseData; import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder; +import uk.gov.hmcts.reform.dashboard.data.TaskStatus; import java.time.LocalDate; @@ -43,7 +44,7 @@ void shouldCreateAddTrialArrangementsForClaimant() throws Exception { .claimsTrack(ClaimsTrack.fastTrack) .orderType(OrderType.DECIDE_DAMAGES) .ccdCaseReference(Long.valueOf(caseId)) - .hearingDate(LocalDate.of(2024, 03, 25)) + .hearingDate(LocalDate.of(2024, 04, 1)) .build(); handler.handle(callbackParams(caseData)); @@ -62,6 +63,20 @@ void shouldCreateAddTrialArrangementsForClaimant() throws Exception { jsonPath("$[0].descriptionCy").value( "
Rhaid i chi gadarnhau eich trefniadau treial erbyn 4 Mawrth 2024. Mae hyn yn golygu y bydd angen i chi gadarnhau a yw'r achos yn barod ar gyfer treial ai peidio. Bydd angen i chi hefyd gadarnhau a yw'r amgylchiadau wedi newid ers i chi gwblhau'r holiadur cyfarwyddiadau. Cyfeiriwch at yr holiadur a gyflwynwyd gennych os nad ydych yn siŵr beth ddywedoch chi o'r blaen.
") ); + + doGet(BEARER_TOKEN, GET_TASKS_ITEMS_URL, caseId, "CLAIMANT") + .andExpectAll( + status().is(HttpStatus.OK.value()), + jsonPath("$[0].reference").value(caseId.toString()), + jsonPath("$[0].taskNameEn").value( + "Add the trial arrangements"), + jsonPath("$[0].currentStatusEn").value(TaskStatus.ACTION_NEEDED.getName()), + jsonPath("$[0].taskNameCy").value( + "Ychwanegu trefniadau'r treial"), + jsonPath("$[0].currentStatusCy").value(TaskStatus.ACTION_NEEDED.getWelshName()), + jsonPath("$[0].hintTextEn").value("Deadline is 12am on 4 March 2024"), + jsonPath("$[0].hintTextCy").value("Deadline is 12am on 4 Mawrth 2024") + ); } } diff --git a/src/integrationTest/java/uk/gov/hmcts/reform/civil/controllers/dashboard/scenarios/defendant/DefendantTrialArrangementsNotificationScenarioTest.java b/src/integrationTest/java/uk/gov/hmcts/reform/civil/controllers/dashboard/scenarios/defendant/DefendantTrialArrangementsNotificationScenarioTest.java index 2b5f6ce86b5..32be5bcab36 100644 --- a/src/integrationTest/java/uk/gov/hmcts/reform/civil/controllers/dashboard/scenarios/defendant/DefendantTrialArrangementsNotificationScenarioTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/reform/civil/controllers/dashboard/scenarios/defendant/DefendantTrialArrangementsNotificationScenarioTest.java @@ -10,6 +10,7 @@ import uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.defendant.TrialArrangementsDefendantNotificationHandler; import uk.gov.hmcts.reform.civil.model.CaseData; import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder; +import uk.gov.hmcts.reform.dashboard.data.TaskStatus; import java.time.LocalDate; @@ -35,7 +36,7 @@ void shouldCreateAddTrialArrangementsForDefendant() throws Exception { .drawDirectionsOrderSmallClaims(NO) .claimsTrack(ClaimsTrack.fastTrack) .orderType(OrderType.DECIDE_DAMAGES) - .hearingDate(LocalDate.of(2024, 03, 25)) + .hearingDate(LocalDate.of(2024, 04, 1)) .build(); handler.handle(callbackParams(caseData)); @@ -54,5 +55,19 @@ void shouldCreateAddTrialArrangementsForDefendant() throws Exception { jsonPath("$[0].descriptionCy").value( "Rhaid i chi gadarnhau eich trefniadau treial erbyn 4 Mawrth 2024. Mae hyn yn golygu y bydd angen i chi gadarnhau a yw'r achos yn barod ar gyfer treial ai peidio. Bydd angen i chi hefyd gadarnhau a yw'r amgylchiadau wedi newid ers i chi gwblhau'r holiadur cyfarwyddiadau. Cyfeiriwch at yr holiadur a gyflwynwyd gennych os nad ydych yn siŵr beth ddywedoch chi o'r blaen.
") ); + + doGet(BEARER_TOKEN, GET_TASKS_ITEMS_URL, caseId, "DEFENDANT") + .andExpectAll( + status().is(HttpStatus.OK.value()), + jsonPath("$[0].reference").value(caseId.toString()), + jsonPath("$[0].taskNameEn").value( + "Add the trial arrangements"), + jsonPath("$[0].currentStatusEn").value(TaskStatus.ACTION_NEEDED.getName()), + jsonPath("$[0].taskNameCy").value( + "Ychwanegu trefniadau'r treial"), + jsonPath("$[0].currentStatusCy").value(TaskStatus.ACTION_NEEDED.getWelshName()), + jsonPath("$[0].hintTextEn").value("Deadline is 12am on 4 March 2024"), + jsonPath("$[0].hintTextCy").value("Deadline is 12am on 4 Mawrth 2024") + ); } } diff --git a/src/main/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapper.java b/src/main/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapper.java index 8d6951cfe41..2ef2099ad47 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapper.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapper.java @@ -208,7 +208,7 @@ && nonNull(caseData.getActiveJudgment().getPaymentPlan()) } if (nonNull(caseData.getHearingDate())) { - LocalDate date = caseData.getHearingDate().minusWeeks(3); + LocalDate date = caseData.getHearingDate().minusWeeks(4); params.put("trialArrangementDeadlineEn", DateUtils.formatDate(date)); params.put("trialArrangementDeadlineCy", DateUtils.formatDateInWelsh(date)); } diff --git a/src/test/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapperTest.java b/src/test/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapperTest.java index 9a04e64c176..93a0a0ee3d9 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapperTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/service/DashboardNotificationsParamsMapperTest.java @@ -179,6 +179,10 @@ public void shouldMapAllParameters_WhenIsRequested() { .isEqualTo("1 Ebrill 2024"); assertThat(result).extracting("hearingFee") .isEqualTo("£100"); + assertThat(result).extracting("trialArrangementDeadlineEn") + .isEqualTo("4 March 2024"); + assertThat(result).extracting("trialArrangementDeadlineCy") + .isEqualTo("4 Mawrth 2024"); } @ParameterizedTest