Search in sources :

Example 6 with SchoolOriginHistory

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

the class SchoolOriginHistoryDaoTest method findByClientId_success_whenSingleRecord.

@Test
public void findByClientId_success_whenSingleRecord() {
    executeInTransaction(sessionFactory, (sessionFactory) -> {
        // when
        final Collection<SchoolOriginHistory> actualResults = testSubject.findByClientId("01234560Wl");
        // then
        assertThat(actualResults.size(), is(1));
        final SchoolOriginHistory actual = actualResults.iterator().next();
        assertThat(actual.getFkchldClt(), is("01234560Wl"));
        assertThat(actual.getThirdId(), is("123yPpp0Wl"));
        assertThat(actual.getSchoolDecision(), is(YesNoUnknown.YES));
        assertThat(actual.getSchoolDecisionDate(), is(LocalDate.of(2013, 2, 2)));
        assertThat(actual.getFkedPvdrt(), is("M6j2wGUq26"));
    });
}
Also used : SchoolOriginHistory(gov.ca.cwds.data.legacy.cms.entity.SchoolOriginHistory) BaseCwsCmsInMemoryPersistenceTest(gov.ca.cwds.data.legacy.cms.persistence.BaseCwsCmsInMemoryPersistenceTest) Test(org.junit.Test)

Example 7 with SchoolOriginHistory

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

the class R10293Test method rule10293_violated_whenOneOfTwoDasHistoriesIsBeforeDOB.

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

Example 8 with SchoolOriginHistory

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

the class ClientTestUtil method schoolOriginHistory.

public static SchoolOriginHistory schoolOriginHistory(LocalDate schoolDecisionDate) {
    SchoolOriginHistory history = new SchoolOriginHistory();
    history.setSchoolDecisionDate(schoolDecisionDate);
    return history;
}
Also used : SchoolOriginHistory(gov.ca.cwds.data.legacy.cms.entity.SchoolOriginHistory)

Aggregations

SchoolOriginHistory (gov.ca.cwds.data.legacy.cms.entity.SchoolOriginHistory)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