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"));
});
}
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);
}
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);
}
Aggregations