Search in sources :

Example 51 with Client

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

the class R06751Test method testStartDateLtBirthDate.

@Test
public void testStartDateLtBirthDate() throws Exception {
    Client client = client(SOME_DATE);
    checkRuleViolatedOnce(dto(client, clientServiceProvider(client, SOME_DATE.minusDays(1))), RULE_NAME);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

Example 52 with Client

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

the class R09729Test method rule09729_violated_whenSingleAlertBeforeDOB.

@Test
public void rule09729_violated_whenSingleAlertBeforeDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final SafetyAlert safetyAlert = safetyAlert(THIRD_ID, SOME_DATE.minusDays(1));
    final ChildClientEntityAwareDTO input = dto(client, safetyAlert);
    // 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 53 with Client

use of gov.ca.cwds.data.legacy.cms.entity.Client 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 54 with Client

use of gov.ca.cwds.data.legacy.cms.entity.Client 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 55 with Client

use of gov.ca.cwds.data.legacy.cms.entity.Client 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)

Aggregations

Client (gov.ca.cwds.data.legacy.cms.entity.Client)127 Test (org.junit.Test)105 ChildClientEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO)21 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)14 ChildClient (gov.ca.cwds.data.legacy.cms.entity.ChildClient)13 BaseCwsCmsInMemoryPersistenceTest (gov.ca.cwds.data.legacy.cms.persistence.BaseCwsCmsInMemoryPersistenceTest)10 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 ClientOtherEthnicity (gov.ca.cwds.data.legacy.cms.entity.ClientOtherEthnicity)4 NameType (gov.ca.cwds.data.legacy.cms.entity.syscodes.NameType)4 Session (org.hibernate.Session)4 Timestamp (java.sql.Timestamp)3 DeliveredService (gov.ca.cwds.data.legacy.cms.entity.DeliveredService)2 OptimisticLockException (javax.persistence.OptimisticLockException)2 IDataSet (org.dbunit.dataset.IDataSet)2 ITable (org.dbunit.dataset.ITable)2 ClientConditionUtils.toClientCondition (gov.ca.cwds.authorizer.util.ClientConditionUtils.toClientCondition)1 FacilityChildParameterObject (gov.ca.cwds.cals.web.rest.parameter.FacilityChildParameterObject)1 ClientEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.ClientEntityAwareDTO)1