Search in sources :

Example 6 with StaffPrivilegeType

use of gov.ca.cwds.authorizer.StaffPrivilegeType in project api-core by ca-cwds.

the class StaffPrivilegeUtilTest method toStaffPersonPrivilegeTypes_success_whenStateSensitive.

@Test
public void toStaffPersonPrivilegeTypes_success_whenStateSensitive() {
    // given
    final PerryAccount input = initPerryAccountWithPrivileges("Sensitive Persons");
    input.setCountyName("State of California");
    // when
    final Set<StaffPrivilegeType> actual = StaffPrivilegeUtil.toStaffPersonPrivilegeTypes(input);
    // then
    assertThat(actual.size(), is(1));
    assertThat(actual, contains(STATE_SENSITIVE));
}
Also used : StaffPrivilegeType(gov.ca.cwds.authorizer.StaffPrivilegeType) PerryAccount(gov.ca.cwds.security.realm.PerryAccount) Test(org.junit.Test)

Example 7 with StaffPrivilegeType

use of gov.ca.cwds.authorizer.StaffPrivilegeType in project api-core by ca-cwds.

the class StaffPrivilegeUtilTest method toStaffPersonPrivilegeTypes_success_whenCountySensitive.

@Test
public void toStaffPersonPrivilegeTypes_success_whenCountySensitive() {
    // given
    final PerryAccount input = initPerryAccountWithPrivileges("Sensitive Persons");
    // when
    final Set<StaffPrivilegeType> actual = StaffPrivilegeUtil.toStaffPersonPrivilegeTypes(input);
    // then
    assertThat(actual.size(), is(1));
    assertThat(actual, contains(COUNTY_SENSITIVE));
}
Also used : StaffPrivilegeType(gov.ca.cwds.authorizer.StaffPrivilegeType) PerryAccount(gov.ca.cwds.security.realm.PerryAccount) Test(org.junit.Test)

Example 8 with StaffPrivilegeType

use of gov.ca.cwds.authorizer.StaffPrivilegeType in project api-core by ca-cwds.

the class StaffPrivilegeUtilTest method toStaffPersonPrivilegeTypes_empty_whenUnknownPerryPrivileges.

@Test
public void toStaffPersonPrivilegeTypes_empty_whenUnknownPerryPrivileges() {
    // given
    final PerryAccount input = initPerryAccountWithPrivileges("a", "bbb");
    // when
    final Set<StaffPrivilegeType> actual = StaffPrivilegeUtil.toStaffPersonPrivilegeTypes(input);
    // then
    assertThat(actual.isEmpty(), is(true));
}
Also used : StaffPrivilegeType(gov.ca.cwds.authorizer.StaffPrivilegeType) PerryAccount(gov.ca.cwds.security.realm.PerryAccount) Test(org.junit.Test)

Example 9 with StaffPrivilegeType

use of gov.ca.cwds.authorizer.StaffPrivilegeType in project api-core by ca-cwds.

the class StaffPrivilegeUtilTest method toStaffPersonPrivilegeTypes_success_whenSocialWorker.

@Test
public void toStaffPersonPrivilegeTypes_success_whenSocialWorker() {
    // given
    final PerryAccount input = initPerryAccountWithPrivileges("CWS Case Management System");
    // when
    final Set<StaffPrivilegeType> actual = StaffPrivilegeUtil.toStaffPersonPrivilegeTypes(input);
    // then
    assertThat(actual.size(), is(1));
    assertThat(actual, contains(SOCIAL_WORKER_ONLY));
}
Also used : StaffPrivilegeType(gov.ca.cwds.authorizer.StaffPrivilegeType) PerryAccount(gov.ca.cwds.security.realm.PerryAccount) Test(org.junit.Test)

Example 10 with StaffPrivilegeType

use of gov.ca.cwds.authorizer.StaffPrivilegeType in project api-core by ca-cwds.

the class StaffPrivilegeUtilTest method toStaffPersonPrivilegeTypes_success_whenCountySealed.

@Test
public void toStaffPersonPrivilegeTypes_success_whenCountySealed() {
    // given
    final PerryAccount input = initPerryAccountWithPrivileges("Sealed");
    // when
    final Set<StaffPrivilegeType> actual = StaffPrivilegeUtil.toStaffPersonPrivilegeTypes(input);
    // then
    assertThat(actual.size(), is(1));
    assertThat(actual, contains(COUNTY_SEALED));
}
Also used : StaffPrivilegeType(gov.ca.cwds.authorizer.StaffPrivilegeType) PerryAccount(gov.ca.cwds.security.realm.PerryAccount) Test(org.junit.Test)

Aggregations

StaffPrivilegeType (gov.ca.cwds.authorizer.StaffPrivilegeType)10 PerryAccount (gov.ca.cwds.security.realm.PerryAccount)10 Test (org.junit.Test)10