Skip to content

Commit

Permalink
Merge pull request #1597 from hmcts/COT-552_sptribs_staff_update
Browse files Browse the repository at this point in the history
COT-552 remove region from sptribs staff roles
  • Loading branch information
mikebrownccd authored Oct 16, 2023
2 parents be72b0e + ac85711 commit 3913a8e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ then
Map<String,JsonNode> attribute = new HashMap<>();
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));

insert(
RoleAssignment.builder()
Expand Down Expand Up @@ -58,7 +57,6 @@ then
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
attribute.put("workTypes", JacksonUtils.convertObjectIntoJsonNode("applications,hearing_work,routine_work,priority"));
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));

insert(
RoleAssignment.builder()
Expand Down Expand Up @@ -172,7 +170,6 @@ then
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
attribute.put("workTypes", JacksonUtils.convertObjectIntoJsonNode("access_requests"));
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));

insert(
RoleAssignment.builder()
Expand Down Expand Up @@ -201,7 +198,6 @@ then
Map<String,JsonNode> attribute = new HashMap<>();
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));

insert(
RoleAssignment.builder()
Expand Down Expand Up @@ -231,7 +227,6 @@ then
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
attribute.put("workTypes", JacksonUtils.convertObjectIntoJsonNode("applications,hearing_work,routine_work,priority"));
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));

insert(
RoleAssignment.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ then
Map<String,JsonNode> attribute = new HashMap<>();
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));

insert(
RoleAssignment.builder()
Expand Down Expand Up @@ -58,7 +57,6 @@ then
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
attribute.put("workTypes", JacksonUtils.convertObjectIntoJsonNode("applications,hearing_work,routine_work,priority,decision_making_work"));
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));

insert(
RoleAssignment.builder()
Expand Down Expand Up @@ -114,9 +112,6 @@ then
Map<String,JsonNode> attribute = new HashMap<>();
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
if ($cap.getRoleId().equals("2")) {
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));
}

insert(
RoleAssignment.builder()
Expand Down Expand Up @@ -146,9 +141,6 @@ then
Map<String,JsonNode> attribute = new HashMap<>();
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
if ($cap.getRoleId().equals("2")) {
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));
}

insert(
RoleAssignment.builder()
Expand Down Expand Up @@ -178,7 +170,6 @@ then
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
attribute.put("workTypes", JacksonUtils.convertObjectIntoJsonNode("access_requests"));
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));

insert(
RoleAssignment.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ then
Map<String,JsonNode> attribute = new HashMap<>();
attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("ST_CIC"));
attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId()));
attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId()));

insert(
RoleAssignment.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ void shouldReturnStcicAdminMappings(String roleId, String serviceCode, String ex
assertEquals("ORGANISATION", r.getRoleType().toString());
});

List<String> roleNamesWithRegionAttribute = List.of("hearing-centre-team-leader", "hearing-centre-admin",
"specific-access-approver-admin", "regional-centre-team-leader", "regional-centre-admin");

roleAssignments.forEach(r -> {
if (r.getRoleName().equals("hmcts-admin")) {
assertNull(r.getAttributes().get("jurisdiction"));
Expand All @@ -90,11 +87,7 @@ void shouldReturnStcicAdminMappings(String roleId, String serviceCode, String ex
assertEquals(cap.getPrimaryLocationId(), r.getAttributes().get("primaryLocation").asText());
}
//assert region
if (roleNamesWithRegionAttribute.contains(r.getRoleName())) {
assertEquals("LDN", r.getAttributes().get("region").asText());
} else {
assertNull(r.getAttributes().get("region"));
}
assertNull(r.getAttributes().get("region"));
//assert work types
if (("hearing-centre-team-leader").equals(r.getRoleName())) {
assertNull(r.getAttributes().get("workTypes"));
Expand Down Expand Up @@ -272,9 +265,6 @@ void shouldReturnStcicCaseWorkerMappings(String roleId, String serviceCode, Stri
assertEquals("ORGANISATION", r.getRoleType().toString());
});

List<String> roleNamesWithRegionAttribute = List.of("senior-tribunal-caseworker", "tribunal-caseworker",
"specific-access-approver-legal-ops");

roleAssignments.forEach(r -> {
if (r.getRoleName().equals("hmcts-legal-operations")) {
assertNull(r.getAttributes().get("jurisdiction"));
Expand All @@ -284,14 +274,7 @@ void shouldReturnStcicCaseWorkerMappings(String roleId, String serviceCode, Stri
assertEquals(cap.getPrimaryLocationId(), r.getAttributes().get("primaryLocation").asText());
}
//assert region
if (roleNamesWithRegionAttribute.contains(r.getRoleName())) {
assertEquals("LDN", r.getAttributes().get("region").asText());
} else if (r.getRoleName().equals("task-supervisor") && !roleId.equals("1")
|| r.getRoleName().equals("case-allocator") && !roleId.equals("1")) {
assertEquals("LDN", r.getAttributes().get("region").asText());
} else {
assertNull(r.getAttributes().get("region"));
}
assertNull(r.getAttributes().get("region"));
//assert work types
if (("senior-tribunal-caseworker").equals(r.getRoleName())) {
assertNull(r.getAttributes().get("workTypes"));
Expand Down Expand Up @@ -364,7 +347,7 @@ void shouldReturnStcicOtherGovDepMappings(String roleId, String serviceCode, Str

roleAssignments.forEach(r -> {
//assert region
assertEquals("LDN", r.getAttributes().get("region").asText());
assertNull(r.getAttributes().get("region"));
//assert work types
if (("cica").equals(r.getRoleName())) {
assertNull(r.getAttributes().get("workTypes"));
Expand Down

0 comments on commit 3913a8e

Please sign in to comment.