use of gov.ca.cwds.data.legacy.cms.entity.FCEligibility in project api-core by ca-cwds.
the class R11126Test method testInValidListOfEligibilities.
@Test
public void testInValidListOfEligibilities() throws Exception {
ChildClient client = createClient(CLIENT_BIRTH_DAY);
clientEntityAwareDTO.setEntity(client);
List<FCEligibility> fcEligibilities = createListOfInvalidChildClientEligibilities();
clientEntityAwareDTO.getFcEligibilities().addAll(fcEligibilities);
checkRuleViolatedOnce(RULE_NAME);
}
use of gov.ca.cwds.data.legacy.cms.entity.FCEligibility in project api-core by ca-cwds.
the class R11126Test method createListOfInvalidChildClientEligibilities.
private static List<FCEligibility> createListOfInvalidChildClientEligibilities() {
FCEligibility eligibility1 = createFcEligibility(CLIENT_ID, CLIENT_BIRTH_DAY.minusDays(1));
FCEligibility eligibility2 = createFcEligibility(CLIENT_ID, CLIENT_BIRTH_DAY.minusMonths(1));
FCEligibility eligibility3 = createFcEligibility(CLIENT_ID, CLIENT_BIRTH_DAY.minusYears(1));
return Arrays.asList(eligibility1, eligibility2, eligibility3);
}
use of gov.ca.cwds.data.legacy.cms.entity.FCEligibility in project api-core by ca-cwds.
the class FCEligibilityDaoTest method testFindByWrongChildClientId.
@Test
public void testFindByWrongChildClientId() throws Exception {
cleanAllAndInsert("/dbunit/Client/update/FCEligibility.xml");
executeInTransaction(sessionFactory, sessionFactory1 -> {
ChildClient childClient = (ChildClient) clientDao.find(WRONG_CHILD_CLIENT_ID);
assertNull(childClient);
});
executeInTransaction(sessionFactory, sessionFactory1 -> {
List<FCEligibility> fcEligibilities = fcEligibilityDao.findByChildClientId(WRONG_CHILD_CLIENT_ID);
assertNotNull(fcEligibilities);
assertEquals(0, fcEligibilities.size());
});
}
use of gov.ca.cwds.data.legacy.cms.entity.FCEligibility in project api-core by ca-cwds.
the class FCEligibilityDaoTest method testFindByChildClientId.
@Test
public void testFindByChildClientId() throws Exception {
cleanAllAndInsert("/dbunit/Client/update/FCEligibility.xml");
executeInTransaction(sessionFactory, sessionFactory1 -> {
ChildClient childClient = (ChildClient) clientDao.find(CHILD_CLIENT_ID);
assertNotNull(childClient);
assertEquals(true, childClient.getAfdcFcEligibilityIndicatorVar());
assertEquals(CHILD_CLIENT_ID, childClient.getVictimClientId());
});
executeInTransaction(sessionFactory, sessionFactory1 -> {
List<FCEligibility> fcEligibilities = fcEligibilityDao.findByChildClientId(CHILD_CLIENT_ID);
assertNotNull(fcEligibilities);
assertEquals(1, fcEligibilities.size());
assertEquals(CHILD_CLIENT_ID, fcEligibilities.get(0).getChildClientId());
});
}
use of gov.ca.cwds.data.legacy.cms.entity.FCEligibility in project api-core by ca-cwds.
the class R11126Test method createFcEligibility.
private static FCEligibility createFcEligibility(String childClientId, LocalDate date) {
FCEligibility eligibility = new FCEligibility();
eligibility.setChildClientId(childClientId);
eligibility.setDate(date);
return eligibility;
}
Aggregations