Search in sources :

Example 76 with Client

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

the class ClientAbstractReadAuthorizerTest method clientDifferentCountySensitiveTest.

@Test
public void clientDifferentCountySensitiveTest() {
    when(clientSensitivityDeterminationService.getClientSensitivityById(CLIENT_ID)).thenReturn(Sensitivity.SENSITIVE);
    when(clientCountyDeterminationService.getClientCountiesById(anyString())).thenReturn(Arrays.asList(new Short[] { 1034, 1012 }));
    final Client client = initClient(Sensitivity.SENSITIVE);
    checkAllCases(client, "1073", "Colusa", false, false, false, false, false);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 77 with Client

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

the class ClientAbstractReadAuthorizerTest method initClient.

private Client initClient(Sensitivity sensitivity) {
    final Client client = new Client();
    client.setIdentifier(CLIENT_ID);
    client.setSensitivity(sensitivity);
    return client;
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client)

Example 78 with Client

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

the class ClientAbstractReadAuthorizerTest method clientNoCountySealedTest.

@Test
public void clientNoCountySealedTest() {
    when(clientSensitivityDeterminationService.getClientSensitivityById(CLIENT_ID)).thenReturn(Sensitivity.SEALED);
    when(clientCountyDeterminationService.getClientCountiesById(anyString())).thenReturn(null);
    final Client client = initClient(Sensitivity.SEALED);
    checkAllCases(client, "1073", "Colusa", false, false, true, false, true);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 79 with Client

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

the class ClientResultReadAuthorizerTest method clientDifferentCountySealedTest.

@Test
public void clientDifferentCountySealedTest() {
    when(clientCountyDeterminationServiceMock.getClientCountiesById(anyString())).thenReturn(Arrays.asList(new Short[] { 1034, 1012 }));
    final Client client = initClient(Sensitivity.SEALED);
    checkAllCases(client, "1073", "Colusa", false, false, false, false, false);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 80 with Client

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

the class ClientResultReadAuthorizerTest method clientNoConditionsTest.

@Test
public void clientNoConditionsTest() {
    when(clientCountyDeterminationServiceMock.getClientCountiesById(anyString())).thenReturn(Arrays.asList(new Short[] { 1023, 1034 }));
    final Client client = initClient(Sensitivity.NOT_APPLICABLE);
    checkAllCases(client, "1073", "Colusa", true, true, true, true, true);
}
Also used : Client(gov.ca.cwds.data.legacy.cms.entity.Client) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) 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