-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/civ-15551-2
- Loading branch information
Showing
52 changed files
with
1,267 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...rm/civil/controllers/dashboard/scenarios/claimant/GeneralAppActionNeededScenarioTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
...eform/civil/controllers/dashboard/scenarios/claimant/GeneralAppAvailableScenarioTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
...form/civil/controllers/dashboard/scenarios/claimant/GeneralAppInProgressScenarioTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...m/civil/controllers/dashboard/scenarios/defendant/GeneralAppActionNeededScenarioTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
...form/civil/controllers/dashboard/scenarios/defendant/GeneralAppAvailableScenarioTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.