Skip to content

Commit

Permalink
CIV-13440 Changing Trial Arrangements Date To 4 weeks Before The Hear…
Browse files Browse the repository at this point in the history
…ing (#5110)

* CIV-13440 changing trial arrangements date to 4 weeks before the hearing date

* CIV-13440 checkstyle error

* CIV-13440 fixing integration tests
  • Loading branch information
kannan-v-hmcts authored Jul 24, 2024
1 parent d8c7fa4 commit 99d0704
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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));
Expand All @@ -62,6 +63,20 @@ void shouldCreateAddTrialArrangementsForClaimant() throws Exception {
jsonPath("$[0].descriptionCy").value(
"<p class=\"govuk-body\">Rhaid i chi <a href=\"{ADD_TRIAL_ARRANGEMENTS}\" class=\"govuk-link\">gadarnhau eich trefniadau treial</a> 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 <a href=\"{VIEW_CLAIMANT_HEARING_REQS}\" rel=\"noopener noreferrer\" class=\"govuk-link\" target=\"_blank\">holiadur a gyflwynwyd gennych</a> os nad ydych yn siŵr beth ddywedoch chi o'r blaen.</p>")
);

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(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Add the trial arrangements</a>"),
jsonPath("$[0].currentStatusEn").value(TaskStatus.ACTION_NEEDED.getName()),
jsonPath("$[0].taskNameCy").value(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Ychwanegu trefniadau'r treial</a>"),
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")
);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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));
Expand All @@ -54,5 +55,19 @@ void shouldCreateAddTrialArrangementsForDefendant() throws Exception {
jsonPath("$[0].descriptionCy").value(
"<p class=\"govuk-body\">Rhaid i chi <a href=\"{ADD_TRIAL_ARRANGEMENTS}\" class=\"govuk-link\">gadarnhau eich trefniadau treial</a> 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 <a href=\"{VIEW_DEFENDANT_HEARING_REQS}\" rel=\"noopener noreferrer\" class=\"govuk-link\" target=\"_blank\">holiadur a gyflwynwyd gennych</a> os nad ydych yn siŵr beth ddywedoch chi o'r blaen.</p>")
);

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(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Add the trial arrangements</a>"),
jsonPath("$[0].currentStatusEn").value(TaskStatus.ACTION_NEEDED.getName()),
jsonPath("$[0].taskNameCy").value(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Ychwanegu trefniadau'r treial</a>"),
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")
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99d0704

Please sign in to comment.