Search in sources :

Example 26 with ChildClientEntityAwareDTO

use of gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO in project api-core by ca-cwds.

the class R10293Test method rule10293_violated_whenOneOfTwoDasHistoriesIsBeforeDOB.

@Test
public void rule10293_violated_whenOneOfTwoDasHistoriesIsBeforeDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final SchoolOriginHistory history0 = schoolOriginHistory(SOME_DATE.plusDays(100));
    final SchoolOriginHistory history1 = schoolOriginHistory(SOME_DATE.minusDays(100));
    final ChildClientEntityAwareDTO input = dto(client, history0, history1);
    // when + then
    checkRuleViolatedOnce(input, RULE_NAME);
}
Also used : SchoolOriginHistory(gov.ca.cwds.data.legacy.cms.entity.SchoolOriginHistory) Client(gov.ca.cwds.data.legacy.cms.entity.Client) ChildClientEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO) Test(org.junit.Test)

Example 27 with ChildClientEntityAwareDTO

use of gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO in project api-core by ca-cwds.

the class R10538Test method rule10538_violatedTwice_whenTwoDasHistoriesBeforeDOB.

@Test
public void rule10538_violatedTwice_whenTwoDasHistoriesBeforeDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final DasHistory dasHistory0 = dasHistory(SOME_DATE.minusDays(1));
    final DasHistory dasHistory1 = dasHistory(SOME_DATE.minusDays(100));
    final ChildClientEntityAwareDTO input = dto(client, dasHistory0, dasHistory1);
    // when + then
    checkRuleViolated(input, RULE_NAME, 2);
}
Also used : DasHistory(gov.ca.cwds.data.legacy.cms.entity.DasHistory) Client(gov.ca.cwds.data.legacy.cms.entity.Client) ChildClientEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO) Test(org.junit.Test)

Example 28 with ChildClientEntityAwareDTO

use of gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO in project api-core by ca-cwds.

the class R10538Test method rule10538_violated_whenOneOfTwoDasHistoriesIsBeforeDOB.

@Test
public void rule10538_violated_whenOneOfTwoDasHistoriesIsBeforeDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final DasHistory dasHistory0 = dasHistory(SOME_DATE.plusDays(100));
    final DasHistory dasHistory1 = dasHistory(SOME_DATE.minusDays(100));
    final ChildClientEntityAwareDTO input = dto(client, dasHistory0, dasHistory1);
    // when + then
    checkRuleViolatedOnce(input, RULE_NAME);
}
Also used : DasHistory(gov.ca.cwds.data.legacy.cms.entity.DasHistory) Client(gov.ca.cwds.data.legacy.cms.entity.Client) ChildClientEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO) Test(org.junit.Test)

Example 29 with ChildClientEntityAwareDTO

use of gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO in project api-core by ca-cwds.

the class ClientTestUtil method dto.

public static ChildClientEntityAwareDTO dto(ChildClient childClient, PaternityDetail... paternityDetails) {
    ChildClientEntityAwareDTO dto = new ChildClientEntityAwareDTO();
    dto.setEntity(childClient);
    dto.setPaternityDetails(Arrays.asList(paternityDetails));
    return dto;
}
Also used : ChildClientEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO)

Example 30 with ChildClientEntityAwareDTO

use of gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO in project api-core by ca-cwds.

the class ClientTestUtil method dto.

public static ChildClientEntityAwareDTO dto(Client client, DasHistory... dasHistories) {
    ChildClientEntityAwareDTO dto = new ChildClientEntityAwareDTO();
    dto.setEntity(client);
    dto.getDasHistories().addAll(Arrays.asList(dasHistories));
    return dto;
}
Also used : ChildClientEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO)

Aggregations

ChildClientEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO)31 Client (gov.ca.cwds.data.legacy.cms.entity.Client)21 Test (org.junit.Test)21 DasHistory (gov.ca.cwds.data.legacy.cms.entity.DasHistory)6 SafetyAlert (gov.ca.cwds.data.legacy.cms.entity.SafetyAlert)6 SchoolOriginHistory (gov.ca.cwds.data.legacy.cms.entity.SchoolOriginHistory)6