Search in sources :

Example 6 with ChildClientEntityAwareDTO

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

the class R09729Test method rule09729_violated_whenOneOfTwoAlertsIsBeforeDOB.

@Test
public void rule09729_violated_whenOneOfTwoAlertsIsBeforeDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final SafetyAlert safetyAlert0 = safetyAlert(THIRD_ID, SOME_DATE.plusDays(100));
    final SafetyAlert safetyAlert1 = safetyAlert(THIRD_ID_2, SOME_DATE.minusDays(100));
    final ChildClientEntityAwareDTO input = dto(client, safetyAlert0, safetyAlert1);
    // when + then
    checkRuleViolatedOnce(input, RULE_NAME);
}
Also used : SafetyAlert(gov.ca.cwds.data.legacy.cms.entity.SafetyAlert) Client(gov.ca.cwds.data.legacy.cms.entity.Client) ChildClientEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO) Test(org.junit.Test)

Example 7 with ChildClientEntityAwareDTO

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

the class R09729Test method rule09729_satisfied_whenNoAlerts.

@Test
public void rule09729_satisfied_whenNoAlerts() 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 8 with ChildClientEntityAwareDTO

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

the class R09729Test method rule09729_violatedTwice_whenTwoAlertsBeforeDOB.

@Test
public void rule09729_violatedTwice_whenTwoAlertsBeforeDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final SafetyAlert safetyAlert0 = safetyAlert(THIRD_ID, SOME_DATE.minusDays(1));
    final SafetyAlert safetyAlert1 = safetyAlert(THIRD_ID_2, SOME_DATE.minusDays(100));
    final ChildClientEntityAwareDTO input = dto(client, safetyAlert0, safetyAlert1);
    // when + then
    checkRuleViolated(input, RULE_NAME, 2);
}
Also used : SafetyAlert(gov.ca.cwds.data.legacy.cms.entity.SafetyAlert) Client(gov.ca.cwds.data.legacy.cms.entity.Client) ChildClientEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO) Test(org.junit.Test)

Example 9 with ChildClientEntityAwareDTO

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

the class R10293Test method rule10293_violatedTwice_whenTwoDasHistoriesBeforeDOB.

@Test
public void rule10293_violatedTwice_whenTwoDasHistoriesBeforeDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final SchoolOriginHistory history0 = schoolOriginHistory(SOME_DATE.minusDays(1));
    final SchoolOriginHistory history1 = schoolOriginHistory(SOME_DATE.minusDays(100));
    final ChildClientEntityAwareDTO input = dto(client, history0, history1);
    // when + then
    checkRuleViolated(input, RULE_NAME, 2);
}
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 10 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_whenSingleDasHistoryBeforeDOB.

@Test
public void rule10293_violated_whenSingleDasHistoryBeforeDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final SchoolOriginHistory history = schoolOriginHistory(SOME_DATE.minusDays(1));
    final ChildClientEntityAwareDTO input = dto(client, history);
    // 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)

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