Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AM-2521 #1879

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

AM-2521 #1879

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 @@ -22,7 +22,6 @@
import uk.gov.hmcts.reform.roleassignment.domain.model.Case;
import uk.gov.hmcts.reform.roleassignment.domain.model.ExistingRoleAssignment;
import uk.gov.hmcts.reform.roleassignment.domain.model.enums.Classification;
import uk.gov.hmcts.reform.roleassignment.domain.model.enums.FeatureFlagEnum;
import uk.gov.hmcts.reform.roleassignment.domain.model.enums.RoleCategory;
import uk.gov.hmcts.reform.roleassignment.domain.model.enums.RoleType;
import uk.gov.hmcts.reform.roleassignment.domain.model.enums.Status;
Expand Down Expand Up @@ -125,7 +124,6 @@ private void setInitMock() {
when(persistenceService.persistRequest(any())).thenReturn(createEntity());
doReturn(assignmentList).when(persistenceService)
.retrieveRoleAssignmentsByQueryRequest(any(), anyInt(), anyInt(), any(), any(), anyBoolean());
when(persistenceService.getStatusByParam(FeatureFlagEnum.IAC_1_1.getValue(), "pr")).thenReturn(true);
when(dataStoreApi.getCaseDataV2(anyString())).thenReturn(Case.builder().id("1212121212121213").jurisdiction(
"IA").caseTypeId("Asylum").securityClassification(Classification.PUBLIC).build());
when(securityUtils.getUserId()).thenReturn("3168da13-00b3-41e3-81fa-cbc71ac28a0f");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import uk.gov.hmcts.reform.roleassignment.domain.model.ExistingRoleAssignment;
import uk.gov.hmcts.reform.roleassignment.domain.model.Request;
import uk.gov.hmcts.reform.roleassignment.domain.model.RoleAssignment;
import uk.gov.hmcts.reform.roleassignment.domain.model.enums.FeatureFlagEnum;
import uk.gov.hmcts.reform.roleassignment.domain.model.enums.GrantType;
import uk.gov.hmcts.reform.roleassignment.domain.model.enums.RoleCategory;
import uk.gov.hmcts.reform.roleassignment.domain.model.enums.RoleType;
Expand Down Expand Up @@ -129,7 +128,6 @@ private void initCommonMocks() {
.thenReturn(TestDataBuilder.buildRequestEntity(
TestDataBuilder.buildRequest(Status.LIVE, false)));
when(securityUtils.getServiceName()).thenReturn("am_org_role_mapping_service");
when(persistenceService.getStatusByParam(FeatureFlagEnum.IAC_1_1.getValue(), "pr")).thenReturn(true);
when(securityUtils.getUserId()).thenReturn(AUTH_USER_ID);

JsonNode attributes = buildAttributesFromFile("attributesCase.json");
Expand Down
5 changes: 0 additions & 5 deletions src/functionalTest/resources/features/F-001/F-001.feature
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ Feature: F-001 : Create Role Assignments
And a successful call [to delete role assignments just created above] as in [DeleteDataForRoleAssignments].

@S-202
@FeatureToggle(RAS:iac_jrd_1_0=on)
Scenario: must successfully create lead-judge Case Role Assignment
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -418,7 +417,6 @@ Feature: F-001 : Create Role Assignments
And a successful call [to delete role assignments just created above] as in [S-202_DeleteDataForRoleAssignmentsForOrgRoles].

@S-203
@FeatureToggle(RAS:iac_jrd_1_0=on)
Scenario: must successfully create hearing-judge Case Role Assignment
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -435,7 +433,6 @@ Feature: F-001 : Create Role Assignments
And a successful call [to delete role assignments just created above] as in [S-203_DeleteDataForRoleAssignmentsForOrgRoles].

@S-204
@FeatureToggle(RAS:iac_jrd_1_0=on)
Scenario: must successfully create ftpa-judge Case Role Assignment
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -452,7 +449,6 @@ Feature: F-001 : Create Role Assignments
And a successful call [to delete role assignments just created above] as in [S-204_DeleteDataForRoleAssignmentsForOrgRoles].

@S-205
@FeatureToggle(RAS:iac_jrd_1_0=on)
Scenario: must successfully create hearing-panel-judge Case Role Assignment
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -469,7 +465,6 @@ Feature: F-001 : Create Role Assignments
And a successful call [to delete role assignments just created above] as in [S-205_DeleteDataForRoleAssignmentsForOrgRoles].

@S-206
@FeatureToggle(RAS:iac_jrd_1_0=on)
Scenario: must successfully create case-allocator Case Role Assignment
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand Down
4 changes: 0 additions & 4 deletions src/functionalTest/resources/features/F-008/F-008.feature
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ Feature: F-008 : Create And Replace Staff Role Assignments for IAC
And a successful call [to delete role assignments just created above] as in [S-106_DeleteDataForRoleAssignmentsForOrgRoles].

@S-201
@FeatureToggle(RAS:iac_1_1=on)
Scenario: must successfully create case-manager Case Role Assignment
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -114,7 +113,6 @@ Feature: F-008 : Create And Replace Staff Role Assignments for IAC
And a successful call [to delete role assignments just created above] as in [S-201_DeleteDataForRoleAssignmentsForOrgRoles].

@S-207
@FeatureToggle(RAS:iac_1_1=on)
Scenario: must successfully create case-allocator Case Role Assignment
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -129,7 +127,6 @@ Feature: F-008 : Create And Replace Staff Role Assignments for IAC
And a successful call [to delete role assignments just created above] as in [S-207_DeleteDataForRoleAssignmentsForOrgRoles].

@S-208
@FeatureToggle(RAS:iac_1_1=on)
Scenario: must successfully create conflict-of-interest Case Role Assignment for self
Given a user with [an active IDAM profile with full permissions],
And a user [Befta2 - who is the actor for requested role],
Expand All @@ -145,7 +142,6 @@ Feature: F-008 : Create And Replace Staff Role Assignments for IAC
And a successful call [to delete role assignments just created above] as in [S-208_DeleteDataForRoleAssignmentsForOrgRoles].

@S-209
@FeatureToggle(RAS:iac_1_1=on)
Scenario: must successfully create conflict-of-interest Case Role Assignment for other Actor
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand Down
4 changes: 0 additions & 4 deletions src/functionalTest/resources/features/F-011/F-011.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Feature: F-011 : Create Specific Role Assignments
Given an appropriate test context as detailed in the test data source

@S-210
@FeatureToggle(RAS:iac_specific_1_0=on)
Scenario: must successfully create specific access requested role for judiciary
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -20,7 +19,6 @@ Feature: F-011 : Create Specific Role Assignments
And a successful call [to delete role assignments just created above] as in [S-210_DeleteDataForRoleAssignmentsForRequestedRole].

@S-212
@FeatureToggle(RAS:iac_specific_1_0=on)
Scenario: must successfully create specific access denied by requester
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -35,7 +33,6 @@ Feature: F-011 : Create Specific Role Assignments
And a successful call [to delete role assignments just created above] as in [S-212_DeleteDataForRoleAssignmentsForOrgRoles],

@S-231
@FeatureToggle(RAS:iac_specific_1_0=on)
Scenario: must successfully create specific access granted role for CIVIL judiciary
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -50,7 +47,6 @@ Feature: F-011 : Create Specific Role Assignments
And a successful call [to delete role assignments just created above] as in [S-231_DeleteDataForRoleAssignmentsForOrgRoles].

@S-232
@FeatureToggle(RAS:iac_specific_1_0=on)
Scenario: must successfully create specific access denied role for PRIVATELAW admin
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand Down
3 changes: 0 additions & 3 deletions src/functionalTest/resources/features/F-012/F-012.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Feature: F-012 : Create Challenged Access Role for IA
Given an appropriate test context as detailed in the test data source

@S-213
@FeatureToggle(RAS:iac_challenged_1_0=on)
Scenario: must successfully create challenged-access-legal-operations role
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -19,7 +18,6 @@ Feature: F-012 : Create Challenged Access Role for IA
And a successful call [to delete role assignments just created above] as in [S-213_DeleteDataForRoleAssignmentsForChallengedAccess].

@S-214
@FeatureToggle(RAS:iac_challenged_1_0=on)
Scenario: must successfully create challenged-access-judiciary role
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -33,7 +31,6 @@ Feature: F-012 : Create Challenged Access Role for IA
And a successful call [to delete role assignments just created above] as in [S-214_DeleteDataForRoleAssignmentsForChallengedAccess].

@S-215
@FeatureToggle(RAS:iac_challenged_1_0=on)
Scenario: must successfully create challenged-access-admin role
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand Down
1 change: 0 additions & 1 deletion src/functionalTest/resources/features/F-013/F-013.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Feature: F-013 : Create CIVIL Challenged Access Role Assignments
Given an appropriate test context as detailed in the test data source

@S-216
@FeatureToggle(RAS:iac_challenged_1_0=on)
Scenario: must successfully create challenged-access-judiciary role
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand Down
2 changes: 0 additions & 2 deletions src/functionalTest/resources/features/F-014/F-014.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Feature: F-014 : Create Challenged Access Role for Privatelaw
Given an appropriate test context as detailed in the test data source

@S-219
@FeatureToggle(RAS:iac_challenged_1_0=on)
Scenario: must successfully create challenged-access-ctsc role
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand All @@ -19,7 +18,6 @@ Feature: F-014 : Create Challenged Access Role for Privatelaw
And a successful call [to delete role assignments just created above] as in [S-219_DeleteDataForRoleAssignmentsForChallengedAccess].

@S-220
@FeatureToggle(RAS:iac_challenged_1_0=on)
Scenario: must successfully create challenged-access-legal-ops role
Given a user with [an active IDAM profile with full permissions],
And a user [Befta1 - who is the actor for requested role],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import static uk.gov.hmcts.reform.roleassignment.helper.TestDataBuilder.getRequestedOrgRole;
import static uk.gov.hmcts.reform.roleassignment.util.JacksonUtils.convertValueJsonNode;

@TestPropertySource(properties = {"org.request.byPassOrgDroolRule=false", "dbFeature.flags.enable=iac_jrd_1_0"})
@TestPropertySource(properties = {"org.request.byPassOrgDroolRule=false"})
public class DroolPassAssignmentCreateAndDeleteIntegrationTest extends BaseTest {

private static final Logger logger =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
Expand Down Expand Up @@ -49,7 +48,6 @@
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static uk.gov.hmcts.reform.roleassignment.domain.model.enums.Status.CREATE_REQUESTED;

@TestPropertySource(properties = {"dbFeature.flags.enable=iac_jrd_1_0"})
public class RoleAssignmentCreateAndDeleteIntegrationTest extends BaseTest {

private static final Logger logger = LoggerFactory.getLogger(RoleAssignmentCreateAndDeleteIntegrationTest.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package uk.gov.hmcts.reform.roleassignment.domain.model.enums;

public enum FeatureFlagEnum {
IAC_1_1("iac_1_1"),
IAC_JRD_1_0("iac_jrd_1_0"),
CCD_BYPASS_1_0("ccd_bypass_1_0"),
IAC_SPECIFIC_1_0("iac_specific_1_0"),
IAC_CHALLENGED_1_0("iac_challenged_1_0"),
WA_BYPASS_1_0("wa_bypass_1_0"),
SSCS_WA_1_0("sscs_wa_1_0");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- AM-2521: Remove old unused DB flags for IAC

delete from flag_config where flag_name='iac_1_1';
delete from flag_config where flag_name='iac_specific_1_0';
delete from flag_config where flag_name='iac_challenged_1_0';
delete from flag_config where flag_name='iac_jrd_1_0';
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import java.time.temporal.ChronoUnit;

rule "civil_create_specific_access_case_role"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue())
$rq: Request(
// The assigner must be the current user.
assignerId == authenticatedUserId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ import java.time.ZoneOffset
import java.time.temporal.ChronoUnit;

/*
* The below rules are required for Challenged Access, It will be toggled on with new IAC_CHALLENGED_1_0 DB flag.
* The below rules are required for Challenged Access.
*/

/*
* All Services: "challenged-access" case roles self creation user
*/
rule "challenged_access_create_case_role"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_CHALLENGED_1_0.getValue())
$rq: Request(
// The assigner must be the current user.
assignerId == authenticatedUserId,
Expand Down Expand Up @@ -82,7 +81,6 @@ end;
*/
rule "challenged_delete_case_role"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_CHALLENGED_1_0.getValue())
$rq: Request(
assignerId == authenticatedUserId)
$ra: RoleAssignment(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import java.time.ZoneOffset
import java.time.temporal.ChronoUnit;

/*
* The below rules are required for Specific Access, It will be toggled on with new IAC_SPECIFIC_1_0 DB flag.
* The below rules are required for Specific Access.
*/


Expand All @@ -28,7 +28,6 @@ import java.time.temporal.ChronoUnit;
*/
rule "create_specific_access_requested_case_role_for_self"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue())
$rq: Request(
// The assigner must be the current user.
assignerId == authenticatedUserId,
Expand Down Expand Up @@ -66,7 +65,6 @@ import java.time.temporal.ChronoUnit;
*/
rule "create_specific_access_denied_case_role_for_self"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue())
$rq: Request(
// The assigner must be the current user.
assignerId == authenticatedUserId,
Expand Down Expand Up @@ -95,7 +93,6 @@ import java.time.temporal.ChronoUnit;
*/
rule "delete_specific_access_request_of_case_role_for_self"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue())
$rq: Request(
// The assignee and the assigner must be the current user.
assignerId == authenticatedUserId)
Expand All @@ -116,7 +113,6 @@ import java.time.temporal.ChronoUnit;
*/
rule "create_specific_access_granted_or_denied_case_role"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue())
$rq: Request(
clientId == "xui_webapp",
process == "specific-access",
Expand Down Expand Up @@ -153,7 +149,6 @@ import java.time.temporal.ChronoUnit;
*/
rule "delete_specific_access_granted_or_denied_case_role"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue())
$rq: Request(
clientId == "xui_webapp",
process == "specific-access",
Expand All @@ -175,7 +170,6 @@ import java.time.temporal.ChronoUnit;

rule "specific_access_approver_create_specific_access_case_role"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue())
$rq: Request(
// The assigner must be the current user.
assignerId == authenticatedUserId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import java.time.ZonedDateTime;
*/
rule "ia_staff_case_allocator_approved_delete_case_role_v11"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_1_1.getValue())
$ca: CaseAllocatorApproval(
roleAssignment.status == Status.DELETE_REQUESTED,
roleAssignment.attributes["jurisdiction"].asText() == "IA")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import java.time.temporal.ChronoUnit;

rule "iac_create_specific_access_case_role"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_SPECIFIC_1_0.getValue())
$rq: Request(
// The assigner must be the current user.
assignerId == authenticatedUserId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import java.time.temporal.ChronoUnit;

rule "ia_lead_judge_create_case_roles"
when
$f: FeatureFlag(status && flagName == FeatureFlagEnum.IAC_JRD_1_0.getValue())
$ca: CaseAllocatorApproval(
roleAssignment.status == Status.CREATE_REQUESTED,
roleAssignment.attributes["jurisdiction"].asText() == "IA",
Expand All @@ -49,7 +48,6 @@ end;

rule "ia_hearing_judge_create_case_roles"
when
$f: FeatureFlag(status && flagName == FeatureFlagEnum.IAC_JRD_1_0.getValue())
$ca: CaseAllocatorApproval(
roleAssignment.status == Status.CREATE_REQUESTED,
roleAssignment.attributes["jurisdiction"].asText() == "IA",
Expand All @@ -74,7 +72,6 @@ end;

rule "ia_ftpa_judge_create_case_roles"
when
$f: FeatureFlag(status && flagName == FeatureFlagEnum.IAC_JRD_1_0.getValue())
$ca: CaseAllocatorApproval(
roleAssignment.status == Status.CREATE_REQUESTED,
roleAssignment.attributes["jurisdiction"].asText() == "IA",
Expand All @@ -99,7 +96,6 @@ end;

rule "ia_hearing_panel_judge_create_case_roles"
when
$f: FeatureFlag(status && flagName == FeatureFlagEnum.IAC_JRD_1_0.getValue())
$ca: CaseAllocatorApproval(
roleAssignment.status == Status.CREATE_REQUESTED,
roleAssignment.attributes["jurisdiction"].asText() == "IA",
Expand All @@ -124,7 +120,6 @@ end;

rule "ia_case_allocator_create_case_roles"
when
$f: FeatureFlag(status && flagName == FeatureFlagEnum.IAC_JRD_1_0.getValue())
$ca: CaseAllocatorApproval(
roleAssignment.status == Status.CREATE_REQUESTED,
roleAssignment.attributes["jurisdiction"].asText() == "IA",
Expand All @@ -149,7 +144,6 @@ end;

rule "ia_judicial_case_allocator_approved_delete_case_role_v11"
when
$f : FeatureFlag(status && flagName == FeatureFlagEnum.IAC_JRD_1_0.getValue())
$ca: CaseAllocatorApproval(
roleAssignment.status == Status.DELETE_REQUESTED,
roleAssignment.attributes["jurisdiction"].asText() == "IA")
Expand Down
Loading