Search in sources :

Example 6 with OtherAdultsInPlacementHome

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

the class R00180Test method checkStartAndEndDateNullValid.

@Test
public void checkStartAndEndDateNullValid() throws Exception {
    OtherAdultsInPlacementHome otherAdultsInPlacementHome = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome.setStartDt(null);
    otherAdultsInPlacementHome.setEndDt(null);
    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 7 with OtherAdultsInPlacementHome

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

the class R00179Test method checkBirthDateLessThen18.

@Test
public void checkBirthDateLessThen18() throws Exception {
    OtherAdultsInPlacementHome otherAdultsInPlacementHome = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome.setBirthDt(LocalDate.now().minus(17, ChronoUnit.YEARS));
    OtherAdultInHomeEntityAwareDTO otherAdultInHomeEntityAwareDTO = new OtherAdultInHomeEntityAwareDTO();
    otherAdultInHomeEntityAwareDTO.setEntity(otherAdultsInPlacementHome);
    placementHomeEntityAwareDTO.getOtherAdultInHomeParameterObjects().add(otherAdultInHomeEntityAwareDTO);
    checkRuleViolatedOnce(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 8 with OtherAdultsInPlacementHome

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

the class R00179Test method checkValidBirthDate.

@Test
public void checkValidBirthDate() throws Exception {
    OtherAdultsInPlacementHome otherAdultsInPlacementHome = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome.setBirthDt(LocalDate.now().minus(20, 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 9 with OtherAdultsInPlacementHome

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

the class R00180Test method checkRuleViolatedForMultipleAdults.

@Test
public void checkRuleViolatedForMultipleAdults() throws Exception {
    OtherAdultsInPlacementHome otherAdultsInPlacementHome1 = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome1.setStartDt(LocalDate.now().minus(10, ChronoUnit.YEARS));
    otherAdultsInPlacementHome1.setEndDt(LocalDate.now().minus(20, ChronoUnit.YEARS));
    otherAdultsInPlacementHome1.setIdentifier("id1");
    OtherAdultInHomeEntityAwareDTO otherAdultInHomeEntityAwareDTO1 = new OtherAdultInHomeEntityAwareDTO();
    otherAdultInHomeEntityAwareDTO1.setEntity(otherAdultsInPlacementHome1);
    placementHomeEntityAwareDTO.getOtherAdultInHomeParameterObjects().add(otherAdultInHomeEntityAwareDTO1);
    OtherAdultsInPlacementHome otherAdultsInPlacementHome2 = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome2.setStartDt(LocalDate.now().minus(19, ChronoUnit.YEARS));
    otherAdultsInPlacementHome2.setEndDt(LocalDate.now().minus(20, ChronoUnit.YEARS));
    otherAdultsInPlacementHome2.setIdentifier("id2");
    OtherAdultInHomeEntityAwareDTO otherAdultInHomeEntityAwareDTO2 = new OtherAdultInHomeEntityAwareDTO();
    otherAdultInHomeEntityAwareDTO2.setEntity(otherAdultsInPlacementHome2);
    placementHomeEntityAwareDTO.getOtherAdultInHomeParameterObjects().add(otherAdultInHomeEntityAwareDTO2);
    checkRuleViolated(placementHomeEntityAwareDTO, RULE_NAME, 2);
}
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 10 with OtherAdultsInPlacementHome

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

the class R00180Test method checkStartMoreThenEndDateFail.

@Test
public void checkStartMoreThenEndDateFail() throws Exception {
    OtherAdultsInPlacementHome otherAdultsInPlacementHome = new OtherAdultsInPlacementHome();
    otherAdultsInPlacementHome.setStartDt(LocalDate.now().minus(10, ChronoUnit.YEARS));
    otherAdultsInPlacementHome.setEndDt(LocalDate.now().minus(20, ChronoUnit.YEARS));
    OtherAdultInHomeEntityAwareDTO otherAdultInHomeEntityAwareDTO = new OtherAdultInHomeEntityAwareDTO();
    otherAdultInHomeEntityAwareDTO.setEntity(otherAdultsInPlacementHome);
    placementHomeEntityAwareDTO.getOtherAdultInHomeParameterObjects().add(otherAdultInHomeEntityAwareDTO);
    checkRuleViolatedOnce(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)

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