Search in sources :

Example 16 with ChildClientEntityAwareDTO

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

the class R10339Test method dto.

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

Example 17 with ChildClientEntityAwareDTO

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

the class R10538Test method rule10538_satisfied_whenTwoDasHistoriesAfterDOB.

@Test
public void rule10538_satisfied_whenTwoDasHistoriesAfterDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final DasHistory dasHistory0 = dasHistory(SOME_DATE.plusDays(1));
    final DasHistory dasHistory1 = dasHistory(SOME_DATE.plusDays(100));
    final ChildClientEntityAwareDTO input = dto(client, dasHistory0, dasHistory1);
    // when + then
    checkRuleSatisfied(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 18 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_whenSingleDasHistoryBeforeDOB.

@Test
public void rule10538_violated_whenSingleDasHistoryBeforeDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final DasHistory dasHistory = dasHistory(SOME_DATE.minusDays(1));
    final ChildClientEntityAwareDTO input = dto(client, dasHistory);
    // 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 19 with ChildClientEntityAwareDTO

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

the class R10538Test method rule10538_satisfied_whenNoDasHistories.

@Test
public void rule10538_satisfied_whenNoDasHistories() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final ChildClientEntityAwareDTO input = dto(client);
    // when + then
    checkRuleSatisfied(input, RULE_NAME);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) ChildClientEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO) Test(org.junit.Test)

Example 20 with ChildClientEntityAwareDTO

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

the class R10538Test method rule10538_satisfied_whenSingleDasHistoryOnDOB.

@Test
public void rule10538_satisfied_whenSingleDasHistoryOnDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final DasHistory dasHistory = dasHistory(SOME_DATE);
    final ChildClientEntityAwareDTO input = dto(client, dasHistory);
    // when + then
    checkRuleSatisfied(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)

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