use of gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider in project api-core by ca-cwds.
the class R00221Test method checkValidBirthDate.
@Test
public void checkValidBirthDate() {
SubstituteCareProvider substituteCareProvider = entityAwareDTO.getEntity();
substituteCareProvider.setBirthDt(LocalDate.now().minus(19L, ChronoUnit.YEARS));
checkSuccess();
}
use of gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider in project api-core by ca-cwds.
the class R00221Test method checkInvalidBirthDate.
@Test
public void checkInvalidBirthDate() {
SubstituteCareProvider substituteCareProvider = entityAwareDTO.getEntity();
substituteCareProvider.setBirthDt(LocalDate.now().minus(17L, ChronoUnit.YEARS));
checkFail("R-00221");
}
use of gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider in project api-core by ca-cwds.
the class R07045Test method testRule.
@Test
public void testRule() throws Exception {
PowerMockito.mockStatic(IdGenerator.class);
when(IdGenerator.generateId()).thenReturn("1q2w3e4r");
PowerMockito.mockStatic(PrincipalUtils.class);
when(PrincipalUtils.getStaffPersonId()).thenReturn("0X5");
SCPEntityAwareDTO scpEntityAwareDTO = new SCPEntityAwareDTO();
scpEntityAwareDTO.setEntity(new SubstituteCareProvider());
// 2 ethnicity was added
scpEntityAwareDTO.setEthnicityList(Arrays.asList(mock(CWSIdentifier.class), mock(CWSIdentifier.class)));
SubstituteCareProvider substituteCareProvider = scpService.create(scpEntityAwareDTO);
// expecting 2 ethnicity to
verify(mockedEthnicityDao, times(2)).create(any());
}
use of gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider in project api-core by ca-cwds.
the class SubstituteCareProviderServiceImplTest method createValidateScpNotPersistent.
@Test
public void createValidateScpNotPersistent() throws Exception {
try {
SubstituteCareProviderCoreService service = new SubstituteCareProviderCoreService(mock(SubstituteCareProviderDao.class));
SubstituteCareProvider scp = new SubstituteCareProvider();
scp.setIdentifier("1");
SCPEntityAwareDTO parameterObject = new SCPEntityAwareDTO();
parameterObject.setEntity(scp);
service.create(parameterObject);
fail();
} catch (IllegalStateException e) {
assertEquals(String.format(ParametersValidator.INSTANCE_MUST_NOT_BE_PERSISTED, SubstituteCareProvider.class.getSimpleName()), e.getMessage());
}
}
use of gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider in project api-core by ca-cwds.
the class BaseDocToolRulesPlacementHomeTest method prepareSuccessfulPlacementHomeEntityAwareDTO.
private PlacementHomeEntityAwareDTO prepareSuccessfulPlacementHomeEntityAwareDTO() {
PlacementHomeEntityAwareDTO placementHomeEntityAwareDTO = new PlacementHomeEntityAwareDTO();
PlacementHome placementHome = new PlacementHome();
placementHome.setAgeToNo((short) 23);
placementHome.setZipNo("11111");
placementHome.setLaPZipno("11111");
placementHome.setpZipNo("11111");
placementHome.setPyeFstnm("PyeFstnm");
placementHome.setPyeLstnm("PyeLstnm");
placementHome.setPstreetNm("PstreetNm");
placementHome.setpCityNm("pCityNm");
placementHome.setPayeeStateCode((short) 1);
SubstituteCareProvider substituteCareProvider = new SubstituteCareProvider();
substituteCareProvider.setZipNo("11111");
placementHome.setPrimarySubstituteCareProvider(substituteCareProvider);
placementHomeEntityAwareDTO.setEntity(placementHome);
return placementHomeEntityAwareDTO;
}
Aggregations