use of gov.ca.cwds.data.legacy.cms.entity.ClientRelationship in project api-core by ca-cwds.
the class R00753Test method overlap3.
/**
* @throws DroolsException
*
* x-------------x
* x-------------x
*/
@Test
public void overlap3() 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(localDateStartA, localDateEndA);
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 R00753Test method overlap4.
/**
* @throws DroolsException
* <p>x-------------x
* x--------x
*/
@Test
public void overlap4() 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(localDateStartA.minusYears(2), localDateEndA.minusYears(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 R00753Test method noOverlap2.
/**
* @throws DroolsException
* x-------------x
* x-----x
*/
@Test
public void noOverlap2() 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(localDateStartA.minusYears(4), localDateStartA.minusDays(1));
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 overlap5.
/**
* @throws DroolsException
*
* x-------------x
* x-----x
*/
@Test
public void overlap5() 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(localDateStartA.minusYears(2), localDateStartA);
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 R00753Test method overlap1.
/**
* @throws DroolsException
*
* x-------------x
* x-------------x
*/
@Test
public void overlap1() 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(localDateStartA.plusYears(1), localDateEndA.plusYears(1));
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);
}
Aggregations