Search in sources :

Example 1 with Client

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

the class FacilityChildService method find.

@Override
public Response find(Serializable params) {
    FacilityChildParameterObject parameterObject = (FacilityChildParameterObject) params;
    Client client = null;
    if (parameterObject.getUnitOfWork().equals(UnitOfWork.CMS)) {
        client = clientService.getClientByFacilityIdAndChildId(parameterObject.getFacilityId(), parameterObject.getChildId());
    } else {
        client = clientService.getClientByLicNumAndChildId(parameterObject.getFacilityId(), parameterObject.getChildId());
    }
    return facilityChildMapper.toFacilityChildDTO(client);
}
Also used : FacilityChildParameterObject(gov.ca.cwds.cals.web.rest.parameter.FacilityChildParameterObject) Client(gov.ca.cwds.data.legacy.cms.entity.Client)

Example 2 with Client

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

the class R00742Test method testValidListofEthnicities.

@Test
public void testValidListofEthnicities() throws Exception {
    Client client = new Client();
    client.setIdentifier(CLIENT_IDENTIFIER);
    client.setPrimaryEthnicityCode((short) 1);
    clientEntityAwareDTO.setEntity(client);
    List<ClientOtherEthnicity> clientScpEthnicityList = createListOfDifferentClientOtherEthnicities(client);
    clientEntityAwareDTO.getOtherEthnicities().addAll(clientScpEthnicityList);
    checkRuleSatisfied(RULE_NAME);
}
Also used : ClientOtherEthnicity(gov.ca.cwds.data.legacy.cms.entity.ClientOtherEthnicity) Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

Example 3 with Client

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

the class R00742Test method testEmptyListOfOtherEthnicitiesWhenPrimaryPresent.

@Test
public void testEmptyListOfOtherEthnicitiesWhenPrimaryPresent() throws Exception {
    Client client = new Client();
    client.setIdentifier(CLIENT_IDENTIFIER);
    client.setPrimaryEthnicityCode((short) 1);
    clientEntityAwareDTO.setEntity(client);
    checkRuleSatisfied(RULE_NAME);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

Example 4 with Client

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

the class R00756Test method testPrimaryRelationshipStartDateGtBirthDate.

@Test
public void testPrimaryRelationshipStartDateGtBirthDate() throws Exception {
    Client client = client(SOME_DATE);
    checkRuleSatisfied(dto(client, primaryRelationship("Aaqj06L00h", client, "AapJGAU04Z", SOME_DATE.plusDays(1))), RULE_NAME);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

Example 5 with Client

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

the class R00756Test method otherClient.

public static Client otherClient(String id) {
    Client client = new Client();
    client.setIdentifier(id);
    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