use of gov.ca.cwds.data.legacy.cms.entity.PlacementHome in project api-core by ca-cwds.
the class PlacementHomeCreateAuthorizerTest method checkResourceMgmtAuthorized.
@Test
public void checkResourceMgmtAuthorized() {
// given
final PerryAccount perryAccount = initPerryAccountWithPrivileges("Resource Mgmt Placement Facility Maint");
perryAccount.setCountyCwsCode("1126");
perryAccount.setCountyCode("99");
perryAccount.setCountyName("State of California");
mockStatic(PerrySubject.class);
when(PerrySubject.getPerryAccount()).thenReturn(perryAccount);
final PlacementHome placementHome = initPlacementHome();
// when
final boolean actual = testSubject.checkInstance(placementHome);
// then
assertThat(actual, is(true));
}
use of gov.ca.cwds.data.legacy.cms.entity.PlacementHome in project api-core by ca-cwds.
the class PlacementHomeCreateAuthorizerTest method checkCWSCaseManagementUnauthorized.
@Test
public void checkCWSCaseManagementUnauthorized() {
// given
final PerryAccount perryAccount = initPerryAccountWithPrivileges("CWS Case Management System");
perryAccount.setCountyCwsCode("1068");
perryAccount.setCountyCode("01");
perryAccount.setCountyName("Alameda");
mockStatic(PerrySubject.class);
when(PerrySubject.getPerryAccount()).thenReturn(perryAccount);
final PlacementHome placementHome = initPlacementHome();
// when
final boolean actual = testSubject.checkInstance(placementHome);
// then
assertThat(actual, is(false));
}
use of gov.ca.cwds.data.legacy.cms.entity.PlacementHome in project api-core by ca-cwds.
the class R03855Test method testMaxAgeInvalid.
@Test
public void testMaxAgeInvalid() throws Exception {
PlacementHome placementHome = new PlacementHome();
placementHome.setAgeToNo((short) 27);
try {
runBusinessValidation(placementHome);
fail();
} catch (BusinessValidationException e) {
assert e.getValidationDetailsList().stream().anyMatch(issueDetails -> issueDetails.getCode().equals("R-03855"));
}
}
use of gov.ca.cwds.data.legacy.cms.entity.PlacementHome in project api-core by ca-cwds.
the class R04966Test method testPyeMidnmValid.
@Test
public void testPyeMidnmValid() {
PlacementHome placementHome = new PlacementHome();
placementHome.setPyeMidnm("A1A");
placementHomeEntityAwareDTO.setEntity(placementHome);
assertValid("R-04966");
}
use of gov.ca.cwds.data.legacy.cms.entity.PlacementHome in project api-core by ca-cwds.
the class R04966Test method testPrmCnctnmInvalid.
@Test
public void testPrmCnctnmInvalid() {
PlacementHome placementHome = new PlacementHome();
placementHome.setPrmCnctnm("S 1 A Sr.");
placementHomeEntityAwareDTO.setEntity(placementHome);
check("R-04966");
}
Aggregations