use of gov.ca.cwds.security.realm.PerryAccount in project api-core by ca-cwds.
the class StaffPrivilegeUtilTest method toStaffPersonPrivilegeTypes_success_whenStateSealed.
@Test
public void toStaffPersonPrivilegeTypes_success_whenStateSealed() {
// given
final PerryAccount input = initPerryAccountWithPrivileges("Sealed");
input.setCountyName("State of California");
// when
final Set<StaffPrivilegeType> actual = StaffPrivilegeUtil.toStaffPersonPrivilegeTypes(input);
// then
assertThat(actual.size(), is(1));
assertThat(actual, contains(STATE_SEALED));
}
use of gov.ca.cwds.security.realm.PerryAccount in project api-core by ca-cwds.
the class StaffPrivilegeUtilTest method toStaffPersonPrivilegeTypes_empty_whenEmptyPerryPrivileges.
@Test
public void toStaffPersonPrivilegeTypes_empty_whenEmptyPerryPrivileges() {
// given
final PerryAccount input = initPerryAccountWithPrivileges();
// when
final Set<StaffPrivilegeType> actual = StaffPrivilegeUtil.toStaffPersonPrivilegeTypes(input);
// then
assertThat(actual.isEmpty(), is(true));
}
use of gov.ca.cwds.security.realm.PerryAccount 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));
}
use of gov.ca.cwds.security.realm.PerryAccount 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));
}
use of gov.ca.cwds.security.realm.PerryAccount in project api-core by ca-cwds.
the class ClientConditionUtilsTest method initUserAccount.
private void initUserAccount(String countyCwsCode) {
PerryAccount perryAccount = new PerryAccount();
perryAccount.setCountyCwsCode(countyCwsCode);
mockStatic(PerrySubject.class);
when(PerrySubject.getPerryAccount()).thenReturn(perryAccount);
}
Aggregations