Search in sources :

Example 11 with Client

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

the class R02769Test method nameTypeChangedAndFirstNameChanged.

@Test
public void nameTypeChangedAndFirstNameChanged() throws Exception {
    Client client = createDoeClient();
    client.setCommonFirstName("FirstName");
    Client persistedClient = createClient();
    persistedClient.setCommonFirstName("NewFirstName");
    clientEntityAwareDTO.setEntity(client);
    clientEntityAwareDTO.setPersistentClientState(persistedClient);
    checkRuleSatisfied(RULE_NAME);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

Example 12 with Client

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

the class R02769Test method createClient.

private static Client createClient() {
    Client client = new Client();
    client.setCommonLastName("DefaultLastName");
    client.setCommonFirstName("DefaultFirstName");
    client.setSuffixTitleDescription("DefaultSuffixDesc");
    NameType nameType = new NameType();
    nameType.setShortDescription("AKA");
    client.setNameType(nameType);
    return client;
}
Also used : NameType(gov.ca.cwds.data.legacy.cms.entity.syscodes.NameType) Client(gov.ca.cwds.data.legacy.cms.entity.Client)

Example 13 with Client

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

the class R02769Test method nameTypeDoeAndFirstNameChanged.

@Test
public void nameTypeDoeAndFirstNameChanged() throws Exception {
    Client client = createDoeClient();
    client.setCommonFirstName("FirstName");
    Client persistedClient = createDoeClient();
    persistedClient.setCommonFirstName("NewFirstName");
    clientEntityAwareDTO.setEntity(client);
    clientEntityAwareDTO.setPersistentClientState(persistedClient);
    checkRuleViolatedOnce(RULE_NAME);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

Example 14 with Client

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

the class R02769Test method nameTypeDoeAndSuffixChanged.

@Test
public void nameTypeDoeAndSuffixChanged() throws Exception {
    Client client = createDoeClient();
    client.setSuffixTitleDescription("SuffixTitleDescription");
    Client persistedClient = createDoeClient();
    persistedClient.setCommonLastName("NewSuffixTitleDescription");
    clientEntityAwareDTO.setEntity(client);
    clientEntityAwareDTO.setPersistentClientState(persistedClient);
    checkRuleViolatedOnce(RULE_NAME);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) Test(org.junit.Test)

Example 15 with Client

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

the class R02769Test method nameTypeChangedAndSuffixChanged.

@Test
public void nameTypeChangedAndSuffixChanged() throws Exception {
    Client client = createDoeClient();
    client.setCommonLastName("LastName");
    client.setCommonFirstName("FirstName");
    client.setSuffixTitleDescription("SuffixTitleDescription");
    Client persistedClient = createClient();
    persistedClient.setCommonLastName("NewSuffixTitleDescription");
    clientEntityAwareDTO.setEntity(client);
    clientEntityAwareDTO.setPersistentClientState(persistedClient);
    checkRuleSatisfied(RULE_NAME);
}
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