Search in sources :

Example 6 with DasHistory

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

the class DasHistoryDaoTest method findByClientId_success_whenSingleRecord.

@Test
public void findByClientId_success_whenSingleRecord() {
    executeInTransaction(sessionFactory, (sessionFactory) -> {
        // when
        final Collection<DasHistory> actualResults = testSubject.findByClientId("9HNHgeH00E");
        // then
        assertThat(actualResults.size(), is(1));
        final DasHistory actual = actualResults.iterator().next();
        assertThat(actual.getFkclientT(), is("9HNHgeH00E"));
        assertThat(actual.getThirdId(), is("9vEL8AG0X5"));
        assertThat(actual.getStartDate(), is(LocalDate.of(2010, 9, 1)));
        assertThat(actual.getEndDate(), is(LocalDate.of(2018, 11, 1)));
        assertThat(actual.getProvidedByCode(), is("R"));
        assertThat(actual.getOtherDescription(), is("Description CCC"));
    });
}
Also used : DasHistory(gov.ca.cwds.data.legacy.cms.entity.DasHistory) BaseCwsCmsInMemoryPersistenceTest(gov.ca.cwds.data.legacy.cms.persistence.BaseCwsCmsInMemoryPersistenceTest) Test(org.junit.Test)

Example 7 with DasHistory

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

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

Aggregations

DasHistory (gov.ca.cwds.data.legacy.cms.entity.DasHistory)8 Test (org.junit.Test)7 ChildClientEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO)6 Client (gov.ca.cwds.data.legacy.cms.entity.Client)6 BaseCwsCmsInMemoryPersistenceTest (gov.ca.cwds.data.legacy.cms.persistence.BaseCwsCmsInMemoryPersistenceTest)1