Search in sources :

Example 1 with ClientRelationship

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

the class BaseDocToolRulesChildClientRelationshipTest method getRelationship.

protected ClientRelationship getRelationship(LocalDate startDate, LocalDate endDate) {
    ClientRelationship clientRelationship = new ClientRelationship();
    clientRelationship.setStartDate(startDate);
    clientRelationship.setEndDate(endDate);
    Client client = new Client();
    client.setIdentifier(PRIMARY_ID);
    Client clientSecondary = new Client();
    clientSecondary.setIdentifier(SECONDARY_ID);
    clientRelationship.setPrimaryClient(client);
    clientRelationship.setSecondaryClient(clientSecondary);
    return clientRelationship;
}
Also used : ClientRelationship(gov.ca.cwds.data.legacy.cms.entity.ClientRelationship) Client(gov.ca.cwds.data.legacy.cms.entity.Client)

Example 2 with ClientRelationship

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

the class R00755Test method testEndDateNull.

@Test
public void testEndDateNull() throws Exception {
    LocalDate date = LocalDate.of(2003, 03, 01);
    ClientRelationship entity = getClientRelationship(date, null);
    awareDTO.setEntity(entity);
    checkRuleSatisfied(RULE_NAME);
}
Also used : ClientRelationship(gov.ca.cwds.data.legacy.cms.entity.ClientRelationship) LocalDate(java.time.LocalDate) Test(org.junit.Test)

Example 3 with ClientRelationship

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

the class R00755Test method startDateLtEndDate.

@Test
public void startDateLtEndDate() throws Exception {
    ClientRelationship entity = getClientRelationship(LocalDate.of(1999, 03, 01), LocalDate.of(2000, 02, 02));
    awareDTO.setEntity(entity);
    checkRuleSatisfied(RULE_NAME);
}
Also used : ClientRelationship(gov.ca.cwds.data.legacy.cms.entity.ClientRelationship) Test(org.junit.Test)

Example 4 with ClientRelationship

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

the class R00755Test method getClientRelationship.

private ClientRelationship getClientRelationship(LocalDate startDate, LocalDate endDate) {
    ClientRelationship entity = new ClientRelationship();
    entity.setStartDate(startDate);
    entity.setEndDate(endDate);
    return entity;
}
Also used : ClientRelationship(gov.ca.cwds.data.legacy.cms.entity.ClientRelationship)

Example 5 with ClientRelationship

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

the class R00755Test method startDateGtEndDate.

@Test
public void startDateGtEndDate() throws Exception {
    ClientRelationship entity = getClientRelationship(LocalDate.of(2001, 01, 01), LocalDate.of(2000, 02, 02));
    awareDTO.setEntity(entity);
    checkRuleViolatedOnce(RULE_NAME);
}
Also used : ClientRelationship(gov.ca.cwds.data.legacy.cms.entity.ClientRelationship) Test(org.junit.Test)

Aggregations

ClientRelationship (gov.ca.cwds.data.legacy.cms.entity.ClientRelationship)19 Test (org.junit.Test)15 LocalDate (java.time.LocalDate)13 ArrayList (java.util.ArrayList)8 Client (gov.ca.cwds.data.legacy.cms.entity.Client)1 YesNoUnknown (gov.ca.cwds.data.legacy.cms.entity.enums.YesNoUnknown)1 ClientRelationshipType (gov.ca.cwds.data.legacy.cms.entity.syscodes.ClientRelationshipType)1 BaseCwsCmsInMemoryPersistenceTest (gov.ca.cwds.data.legacy.cms.persistence.BaseCwsCmsInMemoryPersistenceTest)1 List (java.util.List)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 TestCase.assertTrue (junit.framework.TestCase.assertTrue)1 Assert.assertEquals (org.junit.Assert.assertEquals)1 Assert.assertFalse (org.junit.Assert.assertFalse)1 Before (org.junit.Before)1