use of gov.ca.cwds.data.legacy.cms.entity.ClientRelationship in project api-core by ca-cwds.
the class R00753Test method noOverlap1.
/**
* @throws DroolsException
* <p>x-------------x
* x-------------x
*/
@Test
public void noOverlap1() throws DroolsException {
LocalDate localDateStartA = LocalDate.of(2001, 11, 11);
LocalDate localDateEndA = LocalDate.of(2020, 11, 11);
ClientRelationship entity = getRelationship(localDateStartA, localDateEndA);
awareDTO.setEntity(entity);
List<ClientRelationship> relationships = new ArrayList<>();
ClientRelationship overlapRelationship1 = getRelationship(localDateEndA.plusDays(1), localDateEndA.plusYears(2));
relationships.add(overlapRelationship1);
relationships.add(getRelationship(localDateStartA.minusYears(3), localDateStartA.minusYears(2)));
relationships.add(getRelationship(localDateEndA.plusYears(3), localDateEndA.plusYears(4)));
awareDTO.getClientRelationshipList().addAll(relationships);
checkRuleSatisfied(RULE_NAME);
}
use of gov.ca.cwds.data.legacy.cms.entity.ClientRelationship in project api-core by ca-cwds.
the class R00753Test method overlap6.
/**
* @throws DroolsException
* x-------------x
* x-------x
*/
@Test
public void overlap6() throws DroolsException {
LocalDate localDateStartA = LocalDate.of(2001, 11, 11);
LocalDate localDateEndA = LocalDate.of(2020, 11, 11);
ClientRelationship entity = getRelationship(localDateStartA, localDateEndA);
awareDTO.setEntity(entity);
List<ClientRelationship> relationships = new ArrayList<>();
ClientRelationship overlapRelationship1 = getRelationship(localDateEndA, localDateEndA.plusYears(2));
relationships.add(overlapRelationship1);
relationships.add(getRelationship(localDateStartA.minusYears(3), localDateStartA.minusYears(2)));
relationships.add(getRelationship(localDateEndA.plusYears(3), localDateEndA.plusYears(4)));
awareDTO.getClientRelationshipList().addAll(relationships);
checkRuleViolatedOnce(RULE_NAME);
}
use of gov.ca.cwds.data.legacy.cms.entity.ClientRelationship in project api-core by ca-cwds.
the class R00756Test method getClientRelationship.
private ClientRelationship getClientRelationship(LocalDate startDate, LocalDate endDate) {
ClientRelationship entity = new ClientRelationship();
entity.setStartDate(startDate);
entity.setEndDate(endDate);
return entity;
}
use of gov.ca.cwds.data.legacy.cms.entity.ClientRelationship in project api-core by ca-cwds.
the class R00756Test method clientRelationship.
private static ClientRelationship clientRelationship(String id, Client primaryClient, Client secondaryClient, LocalDate startDate) {
ClientRelationship relationship = new ClientRelationship();
relationship.setIdentifier(id);
relationship.setPrimaryClient(primaryClient);
relationship.setSecondaryClient(secondaryClient);
relationship.setStartDate(startDate);
return relationship;
}
Aggregations