Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ public void should_return_all_work_types() {
Map.of("id", "stf_24w_applications", "label", "Applications - STF"),
Map.of("id", "stf_24w_upper_tribunal", "label", "Upper Tribunal - STF"),
Map.of("id", "stf_24w_access_requests", "label", "Access Requests - STF"),
Map.of("id", "stf_24w_review_case", "label", "Review Case - STF")
Map.of("id", "stf_24w_review_case", "label", "Review Case - STF"),
Map.of("id", "stopped_applications", "label", "Stopped Applications"),
Map.of("id", "queries", "label", "Queries"),
Map.of("id", "queries_stf", "label", "Queries - STF")
);
Assertions.assertEquals(expectedWorkTypes, workTypes);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ void should_return_400_bad_request_when_work_types_did_not_exist() throws Except
+ "intermediate_track_decision_making_work, multi_track_decision_making_work, "
+ "query_work, welsh_translation_work, bail_work, stf_24w_hearing_work, "
+ "stf_24w_routine_work, stf_24w_decision_making_work, stf_24w_applications, "
+ "stf_24w_upper_tribunal, stf_24w_access_requests, stf_24w_review_case]")
+ "stf_24w_upper_tribunal, stf_24w_access_requests, stf_24w_review_case, "
+ "stopped_applications, queries, queries_stf]")
));
}

Expand Down Expand Up @@ -1283,7 +1284,10 @@ void should_return_200_and_accept_Request_when_values_are_null() throws Exceptio
"stf_24w_applications",
"stf_24w_upper_tribunal",
"stf_24w_access_requests",
"stf_24w_review_case"
"stf_24w_review_case",
"stopped_applications",
"queries",
"queries_stf"
})
void should_return_200_and_filter_by_each_work_type(String workType) throws Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void should_return_all_work_types_when_filter_is_not_provided() throws Exception
).andExpectAll(
status().isOk(),
jsonPath("$.work_types").isNotEmpty(),
jsonPath("$.work_types.length()").value(27)
jsonPath("$.work_types.length()").value(30)
).andReturn();


Expand All @@ -153,7 +153,7 @@ void should_return_all_work_types_when_filter_is_false() throws Exception {
).andExpectAll(
status().isOk(),
jsonPath("$.work_types").isNotEmpty(),
jsonPath("$.work_types.length()").value(27)
jsonPath("$.work_types.length()").value(30)
);
}

Expand Down Expand Up @@ -380,6 +380,9 @@ private GetWorkTypesResponse getExpectedWorkTypes() {
WorkType expectedWorkType25 = new WorkType("stf_24w_upper_tribunal", "Upper Tribunal - STF");
WorkType expectedWorkType26 = new WorkType("stf_24w_access_requests", "Access Requests - STF");
WorkType expectedWorkType27 = new WorkType("stf_24w_review_case", "Review Case - STF");
WorkType expectedWorkType28 = new WorkType("stopped_applications", "Stopped Applications");
WorkType expectedWorkType29 = new WorkType("queries", "Queries");
WorkType expectedWorkType30 = new WorkType("queries_stf", "Queries - STF");
return new GetWorkTypesResponse(asList(
expectedWorkType1, expectedWorkType2, expectedWorkType3,
expectedWorkType4, expectedWorkType5, expectedWorkType6,
Expand All @@ -388,7 +391,8 @@ private GetWorkTypesResponse getExpectedWorkTypes() {
expectedWorkType14, expectedWorkType15, expectedWorkType16, expectedWorkType17,
expectedWorkType18, expectedWorkType19, expectedWorkType20, expectedWorkType21,
expectedWorkType22, expectedWorkType23, expectedWorkType24, expectedWorkType25,
expectedWorkType26, expectedWorkType27
expectedWorkType26, expectedWorkType27, expectedWorkType28, expectedWorkType29,
expectedWorkType30
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void should_retrieve_all_work_types() {

final List<WorkType> allWorkTypes = cftWorkTypeDatabaseService.getAllWorkTypes();

assertEquals(27, allWorkTypes.size());
assertEquals(30, allWorkTypes.size());
assertEquals("hearing_work", allWorkTypes.get(0).getId());
assertEquals("Hearing work", allWorkTypes.get(0).getLabel());
assertEquals("upper_tribunal", allWorkTypes.get(1).getId());
Expand Down Expand Up @@ -94,6 +94,12 @@ void should_retrieve_all_work_types() {
assertEquals("Access Requests - STF", allWorkTypes.get(25).getLabel());
assertEquals("stf_24w_review_case", allWorkTypes.get(26).getId());
assertEquals("Review Case - STF", allWorkTypes.get(26).getLabel());
assertEquals("stopped_applications", allWorkTypes.get(27).getId());
assertEquals("Stopped Applications", allWorkTypes.get(27).getLabel());
assertEquals("queries", allWorkTypes.get(28).getId());
assertEquals("Queries", allWorkTypes.get(28).getLabel());
assertEquals("queries_stf", allWorkTypes.get(29).getId());
assertEquals("Queries - STF", allWorkTypes.get(29).getLabel());
}

@Test
Expand Down
27 changes: 25 additions & 2 deletions src/integrationTest/resources/scripts/search_task_work_types.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


INSERT INTO cft_task_db.tasks (task_id, assignee, assignment_expiry, auto_assigned, business_context, case_id, case_name, case_type_id, created,
description, due_date_time, has_warnings, jurisdiction, location, location_name, major_priority, minor_priority,
notes, region, region_name, role_category, security_classification, state, task_name, task_system, task_type,
Expand Down Expand Up @@ -163,7 +165,25 @@ false, 'WA', '765324', 'Taylor House', 0, 0, '[{"user": "userVal", "noteType": "
'1623278362432023', 'TestCase', 'WaCaseType', '2025-05-09T20:15:45.345875+01:00', 'description', '2025-05-09T20:15:45.345875+01:00',
false, 'WA', '765324', 'Taylor House', 0, 0, '[{"user": "userVal", "noteType": "noteTypeVal"}]', '1', 'TestRegion', 'ADMIN',
'PUBLIC', 'ASSIGNED', 'taskName', 'SELF', 'processApplication', null, 'stf_24w_review_case', 'stf_24w_review_case', 'MANUAL',
'2025-05-10T20:15:45.345875+01:00', '2025-05-09T20:15:45.345875+01:00');
'2025-05-10T20:15:45.345875+01:00', '2025-05-09T20:15:45.345875+01:00'),

('8d6cc5cf-c973-11eb-bdba-0242ac111047', 'SELF', '2025-05-09T20:15:45.345875+01:00', false, 'CFT_TASK',
'1623278362432024', 'TestCase', 'WaCaseType', '2025-05-09T20:15:45.345875+01:00', 'description', '2025-05-09T20:15:45.345875+01:00',
false, 'WA', '765324', 'Taylor House', 0, 0, '[{"user": "userVal", "noteType": "noteTypeVal"}]', '1', 'TestRegion', 'ADMIN',
'PUBLIC', 'ASSIGNED', 'taskName', 'SELF', 'processApplication', null, 'stopped_applications', 'stopped_applications', 'MANUAL',
'2025-05-10T20:15:45.345875+01:00', '2025-05-09T20:15:45.345875+01:00'),

('8d6cc5cf-c973-11eb-bdba-0242ac111048', 'SELF', '2025-05-09T20:15:45.345875+01:00', false, 'CFT_TASK',
'1623278362432025', 'TestCase', 'WaCaseType', '2025-05-09T20:15:45.345875+01:00', 'description', '2025-05-09T20:15:45.345875+01:00',
false, 'WA', '765324', 'Taylor House', 0, 0, '[{"user": "userVal", "noteType": "noteTypeVal"}]', '1', 'TestRegion', 'ADMIN',
'PUBLIC', 'ASSIGNED', 'taskName', 'SELF', 'processApplication', null, 'queries', 'queries', 'MANUAL',
'2025-05-10T20:15:45.345875+01:00', '2025-05-09T20:15:45.345875+01:00'),

('8d6cc5cf-c973-11eb-bdba-0242ac111049', 'SELF', '2025-05-09T20:15:45.345875+01:00', false, 'CFT_TASK',
'1623278362432065', 'TestCase', 'WaCaseType', '2025-05-09T20:15:45.345875+01:00', 'description', '2025-05-09T20:15:45.345875+01:00',
false, 'WA', '765324', 'Taylor House', 0, 0, '[{"user": "userVal", "noteType": "noteTypeVal"}]', '1', 'TestRegion', 'ADMIN',
'PUBLIC', 'ASSIGNED', 'taskName', 'SELF', 'processApplication', null, 'queries_stf', 'queries_stf', 'MANUAL',
'2025-05-10T20:15:45.345875+01:00', '2025-05-09T20:15:45.345875+01:00');

INSERT INTO cft_task_db.task_roles (task_role_id, role_name,
"read", own, "execute", manage, cancel,
Expand Down Expand Up @@ -197,5 +217,8 @@ VALUES
('8d6cc5cf-c973-11eb-bdba-0242ac115043', 'tribunal-caseworker', true, false , false , false , false, null, 0, false, 'ADMIN', '8d6cc5cf-c973-11eb-bdba-0242ac111043', '2025-05-09T20:15:45.345875+01:00'),
('8d6cc5cf-c973-11eb-bdba-0242ac115044', 'tribunal-caseworker', true, false , false , false , false, null, 0, false, 'ADMIN', '8d6cc5cf-c973-11eb-bdba-0242ac111044', '2025-05-09T20:15:45.345875+01:00'),
('8d6cc5cf-c973-11eb-bdba-0242ac115045', 'tribunal-caseworker', true, false , false , false , false, null, 0, false, 'ADMIN', '8d6cc5cf-c973-11eb-bdba-0242ac111045', '2025-05-09T20:15:45.345875+01:00'),
('8d6cc5cf-c973-11eb-bdba-0242ac115046', 'tribunal-caseworker', true, false , false , false , false, null, 0, false, 'ADMIN', '8d6cc5cf-c973-11eb-bdba-0242ac111046', '2025-05-09T20:15:45.345875+01:00');
('8d6cc5cf-c973-11eb-bdba-0242ac115046', 'tribunal-caseworker', true, false , false , false , false, null, 0, false, 'ADMIN', '8d6cc5cf-c973-11eb-bdba-0242ac111046', '2025-05-09T20:15:45.345875+01:00'),
('8d6cc5cf-c973-11eb-bdba-0242ac111047', 'tribunal-caseworker', true, false , false , false , false, null, 0, false, 'ADMIN', '8d6cc5cf-c973-11eb-bdba-0242ac111047', '2025-05-09T20:15:45.345875+01:00'),
('8d6cc5cf-c973-11eb-bdba-0242ac111048', 'tribunal-caseworker', true, false , false , false , false, null, 0, false, 'ADMIN', '8d6cc5cf-c973-11eb-bdba-0242ac111048', '2025-05-09T20:15:45.345875+01:00'),
('8d6cc5cf-c973-11eb-bdba-0242ac111049', 'tribunal-caseworker', true, false , false , false , false, null, 0, false, 'ADMIN', '8d6cc5cf-c973-11eb-bdba-0242ac111049', '2025-05-09T20:15:45.345875+01:00');

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class SearchTaskRequestMapper {
"query_work", "welsh_translation_work","bail_work",
"stf_24w_hearing_work", "stf_24w_routine_work", "stf_24w_decision_making_work",
"stf_24w_applications", "stf_24w_upper_tribunal", "stf_24w_access_requests",
"stf_24w_review_case"
"stf_24w_review_case", "stopped_applications", "queries", "queries_stf"
);

private SearchTaskRequestMapper() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
INSERT INTO work_types (work_type_id, label) VALUES
('stopped_applications', 'Stopped Applications'),
('queries', 'Queries'),
('queries_stf', 'Queries - STF')