Skip to content

Commit

Permalink
Merge branch 'master' into feat/civ-15551-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth40343 authored Nov 8, 2024
2 parents 0ea633f + 220f406 commit 6d95704
Show file tree
Hide file tree
Showing 52 changed files with 1,267 additions and 242 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ sonarqube {
property "sonar.coverage.exclusions", "**/model/**, **/config/**/*Configuration.java, **/request/servlet/** , **/controllers/**, **/testingsupport/**, **/*ExternalTaskListener.java, **/*BaseExternalTaskHandler.java, **/stereotypes/**, **/*Exception.java, **/EventHistoryMapper*.java, **/model/hearingvalues/**, **/enums/hearing/**, **/fees/client/**, **/enums/sdo/**, **/service/PaymentsService.java, **/DashboardWithParamsCallbackHandler.java, **/PaymentRequestUpdateCallbackService.java, **/advice/**"
property "sonar.cpd.exclusions", "**/*DocumentManagementService.java, **/*Spec*.java, **/*CcdDashboardClaimantClaimMatcher.java, **/*CcdDashboardDefendantClaimMatcher.java"
property "sonar.exclusions", "**/hmc/model/**, **/model/hearingvalues/**, **/handler/callback/camunda/dashboardnotifications/claimant/CCJRequestedDashboardNotificationHandler.java, **/handler/callback/camunda/dashboardnotifications/claimant/ClaimantCCJResponseNotificationHandler.java" +
", **/handler/callback/camunda/dashboardnotifications/claimant/ClaimantResponseNotificationHandler.java, **/handler/callback/camunda/dashboardnotifications/defendant/MoreTimeRequestedDashboardNotificationDefendantHandler.java, **/handler/callback/camunda/dashboardnotifications/claimant/ClaimantMediationSuccessfulDashboardNotificationHandler.java, **/handler/callback/camunda/dashboardnotifications/claimant/ClaimSettledDashboardNotificationHandler.java, **/handler/callback/camunda/dashboardnotifications/claimant/HearingScheduledClaimantNotificationHandler.java"
", **/handler/callback/camunda/dashboardnotifications/claimant/ClaimantResponseNotificationHandler.java, **/utils/HmcDataUtils.java, **/handler/callback/camunda/dashboardnotifications/defendant/MoreTimeRequestedDashboardNotificationDefendantHandler.java, **/handler/callback/camunda/dashboardnotifications/claimant/ClaimantMediationSuccessfulDashboardNotificationHandler.java, **/handler/callback/camunda/dashboardnotifications/claimant/ClaimSettledDashboardNotificationHandler.java, **/handler/callback/camunda/dashboardnotifications/claimant/HearingScheduledClaimantNotificationHandler.java"
property "sonar.host.url", "https://sonar.reform.hmcts.net/"
property "sonar.web.javaOpts", "-Xmx2G"
}
Expand Down
Binary file modified docker/docmosis/templates/CV-UNS-DEC-ENG-01287.docx
Binary file not shown.
Binary file modified docker/docmosis/templates/CV-UNS-DEC-ENG-01301.docx
Binary file not shown.
Binary file modified docker/docmosis/templates/CV-UNS-DEC-ENG-01302.docx
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void verifyTaskItems(String caseId) throws Exception {
jsonPath("$[1].reference").value(caseId.toString()),
jsonPath("$[1].taskNameEn").value("<a>Contact the court to request a change to my case</a>"),
jsonPath("$[1].currentStatusEn").value(TaskStatus.INACTIVE.getName()),
jsonPath("$[1].taskNameCy").value("<a>Cysylltu â'r llys i ofyn i wneud newid i fy achos</a>"),
jsonPath("$[1].taskNameCy").value("<a>Cysylltu âr llys i wneud cais am newid i fy achos</a>"),
jsonPath("$[1].currentStatusCy").value(TaskStatus.INACTIVE.getWelshName())
);
}
Expand All @@ -145,7 +145,7 @@ private void verifyTaskItemsWithTrialArrangements(String caseId) throws Exceptio
jsonPath("$[2].reference").value(caseId.toString()),
jsonPath("$[2].taskNameEn").value("<a>Contact the court to request a change to my case</a>"),
jsonPath("$[2].currentStatusEn").value(TaskStatus.INACTIVE.getName()),
jsonPath("$[2].taskNameCy").value("<a>Cysylltu â'r llys i ofyn i wneud newid i fy achos</a>"),
jsonPath("$[2].taskNameCy").value("<a>Cysylltu âr llys i wneud cais am newid i fy achos</a>"),
jsonPath("$[2].currentStatusCy").value(TaskStatus.INACTIVE.getWelshName())
);
}
Expand All @@ -172,7 +172,7 @@ private void verifyTaskItemsWithHearingFee(String caseId) throws Exception {
jsonPath("$[3].reference").value(caseId.toString()),
jsonPath("$[3].taskNameEn").value("<a>Contact the court to request a change to my case</a>"),
jsonPath("$[3].currentStatusEn").value(TaskStatus.INACTIVE.getName()),
jsonPath("$[3].taskNameCy").value("<a>Cysylltu â'r llys i ofyn i wneud newid i fy achos</a>"),
jsonPath("$[3].taskNameCy").value("<a>Cysylltu âr llys i wneud cais am newid i fy achos</a>"),
jsonPath("$[3].currentStatusCy").value(TaskStatus.INACTIVE.getWelshName())

);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package uk.gov.hmcts.reform.civil.controllers.dashboard.scenarios.claimant;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.http.HttpStatus;
import org.testcontainers.junit.jupiter.Testcontainers;
import uk.gov.hmcts.reform.civil.controllers.BaseIntegrationTest;
import uk.gov.hmcts.reform.dashboard.data.ScenarioRequestParams;

import java.util.HashMap;
import java.util.UUID;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@Testcontainers
public class GeneralAppActionNeededScenarioTest extends BaseIntegrationTest {

public static final String SCENARIO_GA_ACTION_NEEDED = "Scenario.AAA6.GeneralApplication.ViewApplicationActionNeeded.Claimant";
private static final String DASHBOARD_CREATE_SCENARIO_URL
= "/dashboard/scenarios/{scenario_ref}/{unique_case_identifier}";
private static final String GET_TASKS_ITEMS_URL = "/dashboard/taskList/{ccd-case-identifier}/role/{role-type}";

@Test
void should_create_scenario_for_general_application_action_needed() throws Exception {

UUID caseId = UUID.randomUUID();
doPost(BEARER_TOKEN,
ScenarioRequestParams.builder()
.params(new HashMap<>()).build(),
DASHBOARD_CREATE_SCENARIO_URL, SCENARIO_GA_ACTION_NEEDED, caseId
)
.andExpect(status().isOk());

//Verify task Item is created
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={GENERAL_APPLICATIONS_APPLICATION_SUMMARY_URL} rel=\"noopener noreferrer\" class=\"govuk-link\">View applications</a>"),
jsonPath("$[0].currentStatusEn").value("Action needed")
);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package uk.gov.hmcts.reform.civil.controllers.dashboard.scenarios.claimant;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.http.HttpStatus;
import org.testcontainers.junit.jupiter.Testcontainers;
import uk.gov.hmcts.reform.civil.controllers.BaseIntegrationTest;
import uk.gov.hmcts.reform.dashboard.data.ScenarioRequestParams;

import java.util.HashMap;
import java.util.UUID;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@Testcontainers
public class GeneralAppAvailableScenarioTest extends BaseIntegrationTest {

public static final String SCENARIO_GA_AVAILABLE = "Scenario.AAA6.GeneralApplication.ViewApplicationAvailable.Claimant";
private static final String DASHBOARD_CREATE_SCENARIO_URL
= "/dashboard/scenarios/{scenario_ref}/{unique_case_identifier}";
private static final String GET_TASKS_ITEMS_URL = "/dashboard/taskList/{ccd-case-identifier}/role/{role-type}";

@Test
void should_create_scenario_for_general_application_action_needed() throws Exception {

UUID caseId = UUID.randomUUID();
doPost(BEARER_TOKEN,
ScenarioRequestParams.builder()
.params(new HashMap<>()).build(),
DASHBOARD_CREATE_SCENARIO_URL, SCENARIO_GA_AVAILABLE, caseId
)
.andExpect(status().isOk());

//Verify task Item is created
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={GENERAL_APPLICATIONS_APPLICATION_SUMMARY_URL} rel=\"noopener noreferrer\" class=\"govuk-link\">View applications</a>"),
jsonPath("$[0].currentStatusEn").value("Available")
);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package uk.gov.hmcts.reform.civil.controllers.dashboard.scenarios.claimant;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.http.HttpStatus;
import org.testcontainers.junit.jupiter.Testcontainers;
import uk.gov.hmcts.reform.civil.controllers.BaseIntegrationTest;
import uk.gov.hmcts.reform.dashboard.data.ScenarioRequestParams;

import java.util.HashMap;
import java.util.UUID;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@Testcontainers
public class GeneralAppInProgressScenarioTest extends BaseIntegrationTest {

public static final String SCENARIO_GA_IN_PROGRESS = "Scenario.AAA6.GeneralApplication.ViewApplicationInProgress.Claimant";
private static final String DASHBOARD_CREATE_SCENARIO_URL
= "/dashboard/scenarios/{scenario_ref}/{unique_case_identifier}";
private static final String GET_TASKS_ITEMS_URL = "/dashboard/taskList/{ccd-case-identifier}/role/{role-type}";

@Test
void should_create_scenario_for_general_application_action_needed() throws Exception {

UUID caseId = UUID.randomUUID();
doPost(BEARER_TOKEN,
ScenarioRequestParams.builder()
.params(new HashMap<>()).build(),
DASHBOARD_CREATE_SCENARIO_URL, SCENARIO_GA_IN_PROGRESS, caseId
)
.andExpect(status().isOk());

//Verify task Item is created
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={GENERAL_APPLICATIONS_APPLICATION_SUMMARY_URL} rel=\"noopener noreferrer\" class=\"govuk-link\">View applications</a>"),
jsonPath("$[0].currentStatusEn").value("In progress")
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
import uk.gov.hmcts.reform.civil.enums.YesOrNo;
import uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.defendant.CaseProceedOfflineDefendantNotificationHandler;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.model.judgmentonline.JudgmentDetails;
import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder;
import uk.gov.hmcts.reform.dashboard.data.TaskStatus;

import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

Expand All @@ -19,7 +22,7 @@ public class CaseProceedOfflineDefendantScenarioTest extends DashboardBaseIntegr
private CaseProceedOfflineDefendantNotificationHandler handler;

@Test
void should_create_case_proceed_offline__claimant_scenario() throws Exception {
void should_create_case_proceed_offline_defendant_scenario() throws Exception {

String caseId = "72016577145";

Expand Down Expand Up @@ -58,4 +61,39 @@ void should_create_case_proceed_offline__claimant_scenario() throws Exception {

);
}

@Test
void shouldUpdateCaseProceedOffLineTaskList() throws Exception {

String caseId = "72016577333";

CaseData caseData = CaseDataBuilder.builder().atStateRespondentPartAdmissionSpec().build()
.toBuilder()
.legacyCaseReference("reference")
.ccdCaseReference(Long.valueOf(caseId))
.respondent1Represented(YesOrNo.NO)
.activeJudgment(JudgmentDetails.builder().build())
.previousCCDState(CaseState.All_FINAL_ORDERS_ISSUED)
.build();
when(featureToggleService.isCaseProgressionEnabled()).thenReturn(true);
when(featureToggleService.isCoSCEnabled()).thenReturn(true);

handler.handle(callbackParams(caseData));

//Verify task Item is created
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>Upload hearing documents</a>"),
jsonPath("$[0].currentStatusEn").value(TaskStatus.INACTIVE.getName()),
jsonPath("$[0].taskNameCy").value("<a>Llwytho dogfennau'r gwrandawiad</a>"),
jsonPath("$[0].currentStatusCy").value(TaskStatus.INACTIVE.getWelshName()),
jsonPath("$[1].reference").value(caseId.toString()),
jsonPath("$[1].taskNameEn").value("<a>Confirm you've paid a judgment (CCJ) debt</a>"),
jsonPath("$[1].currentStatusEn").value(TaskStatus.INACTIVE.getName()),
jsonPath("$[1].taskNameCy").value("<a>Cadarnhewch eich bod wedi talu dyled dyfarniad (CCJ)</a>"),
jsonPath("$[1].currentStatusCy").value(TaskStatus.INACTIVE.getWelshName())
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package uk.gov.hmcts.reform.civil.controllers.dashboard.scenarios.defendant;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.http.HttpStatus;
import org.testcontainers.junit.jupiter.Testcontainers;
import uk.gov.hmcts.reform.civil.controllers.BaseIntegrationTest;
import uk.gov.hmcts.reform.dashboard.data.ScenarioRequestParams;

import java.util.HashMap;
import java.util.UUID;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@Testcontainers
public class GeneralAppActionNeededScenarioTest extends BaseIntegrationTest {

public static final String SCENARIO_GA_ACTION_NEEDED = "Scenario.AAA6.GeneralApplication.ViewApplicationActionNeeded.Defendant";
private static final String DASHBOARD_CREATE_SCENARIO_URL
= "/dashboard/scenarios/{scenario_ref}/{unique_case_identifier}";
private static final String GET_TASKS_ITEMS_URL = "/dashboard/taskList/{ccd-case-identifier}/role/{role-type}";

@Test
void should_create_scenario_for_general_application_action_needed() throws Exception {

UUID caseId = UUID.randomUUID();
doPost(BEARER_TOKEN,
ScenarioRequestParams.builder()
.params(new HashMap<>()).build(),
DASHBOARD_CREATE_SCENARIO_URL, SCENARIO_GA_ACTION_NEEDED, caseId
)
.andExpect(status().isOk());

//Verify task Item is created
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={GENERAL_APPLICATIONS_RESPONSE_APPLICATION_SUMMARY_URL} rel=\"noopener noreferrer\" class=\"govuk-link\">View applications</a>"),
jsonPath("$[0].currentStatusEn").value("Action needed")
);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package uk.gov.hmcts.reform.civil.controllers.dashboard.scenarios.defendant;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.http.HttpStatus;
import org.testcontainers.junit.jupiter.Testcontainers;
import uk.gov.hmcts.reform.civil.controllers.BaseIntegrationTest;
import uk.gov.hmcts.reform.dashboard.data.ScenarioRequestParams;

import java.util.HashMap;
import java.util.UUID;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@Testcontainers
public class GeneralAppAvailableScenarioTest extends BaseIntegrationTest {

public static final String SCENARIO_GA_AVAILABLE = "Scenario.AAA6.GeneralApplication.ViewApplicationAvailable.Defendant";
private static final String DASHBOARD_CREATE_SCENARIO_URL
= "/dashboard/scenarios/{scenario_ref}/{unique_case_identifier}";
private static final String GET_TASKS_ITEMS_URL = "/dashboard/taskList/{ccd-case-identifier}/role/{role-type}";

@Test
void should_create_scenario_for_general_application_action_needed() throws Exception {

UUID caseId = UUID.randomUUID();
doPost(BEARER_TOKEN,
ScenarioRequestParams.builder()
.params(new HashMap<>()).build(),
DASHBOARD_CREATE_SCENARIO_URL, SCENARIO_GA_AVAILABLE, caseId
)
.andExpect(status().isOk());

//Verify task Item is created
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={GENERAL_APPLICATIONS_RESPONSE_APPLICATION_SUMMARY_URL} rel=\"noopener noreferrer\" class=\"govuk-link\">View applications</a>"),
jsonPath("$[0].currentStatusEn").value("Available")
);
}

}
Loading

0 comments on commit 6d95704

Please sign in to comment.