diff --git a/src/main/resources/validationrules/stcic/stcic-admin-mapping.drl b/src/main/resources/validationrules/stcic/stcic-admin-mapping.drl index de7bbcf7d..d98046232 100644 --- a/src/main/resources/validationrules/stcic/stcic-admin-mapping.drl +++ b/src/main/resources/validationrules/stcic/stcic-admin-mapping.drl @@ -28,7 +28,6 @@ then Map 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() @@ -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() @@ -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() @@ -201,7 +198,6 @@ then Map 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() @@ -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() diff --git a/src/main/resources/validationrules/stcic/stcic-caseworker-mapping.drl b/src/main/resources/validationrules/stcic/stcic-caseworker-mapping.drl index 890db87f7..2f9fd109f 100644 --- a/src/main/resources/validationrules/stcic/stcic-caseworker-mapping.drl +++ b/src/main/resources/validationrules/stcic/stcic-caseworker-mapping.drl @@ -28,7 +28,6 @@ then Map 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() @@ -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() @@ -114,9 +112,6 @@ then Map 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() @@ -146,9 +141,6 @@ then Map 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() @@ -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() diff --git a/src/main/resources/validationrules/stcic/stcic-other-mapping.drl b/src/main/resources/validationrules/stcic/stcic-other-mapping.drl index a3e9a6741..1d291be12 100644 --- a/src/main/resources/validationrules/stcic/stcic-other-mapping.drl +++ b/src/main/resources/validationrules/stcic/stcic-other-mapping.drl @@ -28,7 +28,6 @@ then Map 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() diff --git a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolStcicStaffOrgRoleTest.java b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolStcicStaffOrgRoleTest.java index d3c6e9cd6..34d577be8 100644 --- a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolStcicStaffOrgRoleTest.java +++ b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolStcicStaffOrgRoleTest.java @@ -78,9 +78,6 @@ void shouldReturnStcicAdminMappings(String roleId, String serviceCode, String ex assertEquals("ORGANISATION", r.getRoleType().toString()); }); - List 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")); @@ -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")); @@ -272,9 +265,6 @@ void shouldReturnStcicCaseWorkerMappings(String roleId, String serviceCode, Stri assertEquals("ORGANISATION", r.getRoleType().toString()); }); - List 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")); @@ -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")); @@ -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"));