Search in sources :

Example 66 with Client

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

the class R10538Test method rule10538_satisfied_whenSingleDasHistoryAfterDOB.

@Test
public void rule10538_satisfied_whenSingleDasHistoryAfterDOB() throws DroolsException {
    // given
    final Client client = client(SOME_DATE);
    final DasHistory dasHistory = dasHistory(SOME_DATE.plusDays(100));
    final ChildClientEntityAwareDTO input = dto(client, dasHistory);
    // when + then
    checkRuleSatisfied(input, RULE_NAME);
}
Also used : DasHistory(gov.ca.cwds.data.legacy.cms.entity.DasHistory) Client(gov.ca.cwds.data.legacy.cms.entity.Client) ChildClientEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO) Test(org.junit.Test)

Example 67 with Client

use of gov.ca.cwds.data.legacy.cms.entity.Client 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 68 with Client

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

the class R00756Test method getClient.

private Client getClient(LocalDate birthDate) {
    Client client = new Client();
    client.setBirthDate(birthDate);
    return client;
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client)

Example 69 with Client

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

the class ClientDao method findByFacilityIdAndChildId.

/**
 * @param facilityId facility primary key
 * @param childId child primary key
 * @return child by facility id number and child id.
 */
public Client findByFacilityIdAndChildId(String facilityId, String childId) {
    Client client = findSingleFacility("findByFacilityIdAndChildId", query -> {
        query.setParameter("facilityId", facilityId);
        query.setParameter("childId", childId);
    });
    if (client == null) {
        LOG.warn("There is no result for facilityId = {} and childId = {}", facilityId, childId);
    }
    return client;
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client)

Example 70 with Client

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

the class ClientDao method findByLicNumAndChildId.

/**
 * @param licenseNumber license number
 * @param childId child primary key
 * @return child by license number and child id.
 */
public Client findByLicNumAndChildId(String licenseNumber, String childId) {
    Client client = findSingleFacility("find", query -> {
        query.setParameter("licenseNumber", licenseNumber);
        query.setParameter("childId", childId);
    });
    if (client == null) {
        LOG.warn("There is no result for licenseNumber = {} and childId = {}", licenseNumber, childId);
    }
    return client;
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client)

Aggregations

Client (gov.ca.cwds.data.legacy.cms.entity.Client)127 Test (org.junit.Test)105 ChildClientEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.ChildClientEntityAwareDTO)21 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)14 ChildClient (gov.ca.cwds.data.legacy.cms.entity.ChildClient)13 BaseCwsCmsInMemoryPersistenceTest (gov.ca.cwds.data.legacy.cms.persistence.BaseCwsCmsInMemoryPersistenceTest)10 DasHistory (gov.ca.cwds.data.legacy.cms.entity.DasHistory)6 SafetyAlert (gov.ca.cwds.data.legacy.cms.entity.SafetyAlert)6 SchoolOriginHistory (gov.ca.cwds.data.legacy.cms.entity.SchoolOriginHistory)6 ClientOtherEthnicity (gov.ca.cwds.data.legacy.cms.entity.ClientOtherEthnicity)4 NameType (gov.ca.cwds.data.legacy.cms.entity.syscodes.NameType)4 Session (org.hibernate.Session)4 Timestamp (java.sql.Timestamp)3 DeliveredService (gov.ca.cwds.data.legacy.cms.entity.DeliveredService)2 OptimisticLockException (javax.persistence.OptimisticLockException)2 IDataSet (org.dbunit.dataset.IDataSet)2 ITable (org.dbunit.dataset.ITable)2 ClientConditionUtils.toClientCondition (gov.ca.cwds.authorizer.util.ClientConditionUtils.toClientCondition)1 FacilityChildParameterObject (gov.ca.cwds.cals.web.rest.parameter.FacilityChildParameterObject)1 ClientEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.ClientEntityAwareDTO)1