Search in sources :

Example 11 with OtherAdultsInPlacementHome

use of gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome in project api-core by ca-cwds.

the class R00180Test method checkValidDates.

@Test
public void checkValidDates() throws Exception {
    OtherAdultsInPlacementHome otherAdultsInPlacementHome = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome.setStartDt(LocalDate.now().minus(20, ChronoUnit.YEARS));
    otherAdultsInPlacementHome.setEndDt(LocalDate.now().minus(10, ChronoUnit.YEARS));
    OtherAdultInHomeEntityAwareDTO otherAdultInHomeEntityAwareDTO = new OtherAdultInHomeEntityAwareDTO();
    otherAdultInHomeEntityAwareDTO.setEntity(otherAdultsInPlacementHome);
    placementHomeEntityAwareDTO.getOtherAdultInHomeParameterObjects().add(otherAdultInHomeEntityAwareDTO);
    checkRuleValid(placementHomeEntityAwareDTO, RULE_NAME);
}
Also used : OtherAdultInHomeEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.OtherAdultInHomeEntityAwareDTO) OtherAdultsInPlacementHome(gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome) Test(org.junit.Test)

Example 12 with OtherAdultsInPlacementHome

use of gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome in project api-core by ca-cwds.

the class R00180Test method checkStartDateNullValid.

@Test
public void checkStartDateNullValid() throws Exception {
    OtherAdultsInPlacementHome otherAdultsInPlacementHome = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome.setStartDt(null);
    otherAdultsInPlacementHome.setEndDt(LocalDate.now().minus(10, ChronoUnit.YEARS));
    OtherAdultInHomeEntityAwareDTO otherAdultInHomeEntityAwareDTO = new OtherAdultInHomeEntityAwareDTO();
    otherAdultInHomeEntityAwareDTO.setEntity(otherAdultsInPlacementHome);
    placementHomeEntityAwareDTO.getOtherAdultInHomeParameterObjects().add(otherAdultInHomeEntityAwareDTO);
    checkRuleValid(placementHomeEntityAwareDTO, RULE_NAME);
}
Also used : OtherAdultInHomeEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.OtherAdultInHomeEntityAwareDTO) OtherAdultsInPlacementHome(gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome) Test(org.junit.Test)

Example 13 with OtherAdultsInPlacementHome

use of gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome in project api-core by ca-cwds.

the class R10227Test method testIdentifiedDateInvalid.

@Test
public void testIdentifiedDateInvalid() {
    OtherAdultsInPlacementHome otherAdultsInPlacementHome = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome.setBirthDt(LocalDate.now().minus(20, ChronoUnit.YEARS));
    otherAdultsInPlacementHome.setIdentfdDt(LocalDate.now().minus(30, ChronoUnit.YEARS));
    OtherAdultInHomeEntityAwareDTO otherAdultInHomeEntityAwareDTO = new OtherAdultInHomeEntityAwareDTO();
    otherAdultInHomeEntityAwareDTO.setEntity(otherAdultsInPlacementHome);
    placementHomeEntityAwareDTO.setOtherAdultInHomeParameterObjects(Collections.singletonList(otherAdultInHomeEntityAwareDTO));
    check("R-10227");
}
Also used : OtherAdultInHomeEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.OtherAdultInHomeEntityAwareDTO) OtherAdultsInPlacementHome(gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome) Test(org.junit.Test)

Example 14 with OtherAdultsInPlacementHome

use of gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome in project api-core by ca-cwds.

the class R10227Test method testIdentifiedDateValid.

@Test
public void testIdentifiedDateValid() {
    OtherAdultsInPlacementHome otherAdultsInPlacementHome = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome.setBirthDt(LocalDate.now().minus(20, ChronoUnit.YEARS));
    otherAdultsInPlacementHome.setIdentfdDt(LocalDate.now().minus(10, ChronoUnit.YEARS));
    OtherAdultInHomeEntityAwareDTO otherAdultInHomeEntityAwareDTO = new OtherAdultInHomeEntityAwareDTO();
    otherAdultInHomeEntityAwareDTO.setEntity(otherAdultsInPlacementHome);
    placementHomeEntityAwareDTO.setOtherAdultInHomeParameterObjects(Collections.singletonList(otherAdultInHomeEntityAwareDTO));
    assertValid();
}
Also used : OtherAdultInHomeEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.OtherAdultInHomeEntityAwareDTO) OtherAdultsInPlacementHome(gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome) Test(org.junit.Test)

Example 15 with OtherAdultsInPlacementHome

use of gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome in project api-core by ca-cwds.

the class R03821Test method checkInvalidStartAndBirthDate.

@Test
public void checkInvalidStartAndBirthDate() throws Exception {
    OtherAdultsInPlacementHome otherAdultsInPlacementHome = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome.setStartDt(LocalDate.now());
    otherAdultsInPlacementHome.setBirthDt(LocalDate.now().plus(1, ChronoUnit.DAYS));
    placementHomeEntityAwareDTO.getEntity().setOtherAdultsInPlacementHomes(Collections.singletonList(otherAdultsInPlacementHome));
    checkRuleViolatedOnce(placementHomeEntityAwareDTO, RULE_NAME);
}
Also used : OtherAdultsInPlacementHome(gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome) Test(org.junit.Test)

Aggregations

OtherAdultsInPlacementHome (gov.ca.cwds.data.legacy.cms.entity.OtherAdultsInPlacementHome)15 Test (org.junit.Test)15 OtherAdultInHomeEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.OtherAdultInHomeEntityAwareDTO)13