Search in sources :

Example 26 with Client

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

the class R00741Test method testLanguagesAreTheSame.

@Test
public void testLanguagesAreTheSame() throws Exception {
    Client client = new Client();
    client.setPrimaryLanguageCode((short) 1);
    client.setSecondaryLanguageCode((short) 1);
    checkRuleViolatedOnce(client, RULE_NAME);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

Example 27 with Client

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

the class R00743Test method testPrimarySecondaryLanguagesEmpty.

@Test
public void testPrimarySecondaryLanguagesEmpty() throws DroolsException {
    Client client = new Client();
    client.setPrimaryLanguageCode((short) 0);
    client.setSecondaryLanguageCode((short) 0);
    clientEntityAwareDTO.setEntity(client);
    checkRuleSatisfied(RULE_NAME);
}
Also used : ChildClient(gov.ca.cwds.data.legacy.cms.entity.ChildClient) Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

Example 28 with Client

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

the class R05786Test method createClient.

private static Client createClient(String firstName, String lastName, String middleName) {
    Client client = ClientTestUtil.client();
    client.setCommonLastName(lastName);
    client.setCommonFirstName(firstName);
    client.setCommonMiddleName(middleName);
    return client;
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client)

Example 29 with Client

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

the class R05786Test method testAllNamePartsChanged.

@Test
public void testAllNamePartsChanged() throws DroolsException {
    Client client = createClient(NEW_FIRST_NAME, NEW_LAST_NAME, NEW_MIDDLE_NAME);
    Client persistedClient = createPersistedClient();
    clientEntityAwareDTO.setEntity(client);
    clientEntityAwareDTO.setPersistentClientState(persistedClient);
    businessValidationService.runDataProcessing(clientEntityAwareDTO, principal, ClientDroolsConfiguration.INSTANCE);
    assert clientEntityAwareDTO.getOtherClientName() != null;
    assert clientEntityAwareDTO.getOtherClientName().getLastName().equals(OLD_LAST_NAME);
    assert clientEntityAwareDTO.getOtherClientName().getFirstName().equals(OLD_FIRST_NAME);
    assert clientEntityAwareDTO.getOtherClientName().getMiddleName().equals(OLD_MIDDLE_NAME);
    assert clientEntityAwareDTO.getOtherClientName().getNameType() == AKA_NAMETYPE_SYSID;
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

Example 30 with Client

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

the class R05786Test method testLastNameNotChanged.

@Test
public void testLastNameNotChanged() throws DroolsException {
    Client client = createClient(NEW_FIRST_NAME, OLD_LAST_NAME, NEW_MIDDLE_NAME);
    Client persistedClient = createPersistedClient();
    clientEntityAwareDTO.setEntity(client);
    clientEntityAwareDTO.setPersistentClientState(persistedClient);
    businessValidationService.runDataProcessing(clientEntityAwareDTO, principal, ClientDroolsConfiguration.INSTANCE);
    assert clientEntityAwareDTO.getOtherClientName() == null;
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

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