use of gov.ca.cwds.data.legacy.cms.entity.Client in project api-core by ca-cwds.
the class ClientResultReadAuthorizerTest method clientSameCountySensitiveTest.
@Test
public void clientSameCountySensitiveTest() {
when(clientCountyDeterminationServiceMock.getClientCountiesById(anyString())).thenReturn(Arrays.asList(new Short[] { 1073, 10 }));
final Client client = initClient(Sensitivity.SENSITIVE);
checkAllCases(client, "1073", "Colusa", true, true, true, true, true);
}
use of gov.ca.cwds.data.legacy.cms.entity.Client in project api-core by ca-cwds.
the class ClientResultReadAuthorizerTest method clientNoCountySensitiveTest.
@Test
public void clientNoCountySensitiveTest() {
when(clientCountyDeterminationServiceMock.getClientCountiesById(anyString())).thenReturn(null);
final Client client = initClient(Sensitivity.SENSITIVE);
checkAllCases(client, "1073", "Colusa", true, true, true, true, true);
}
use of gov.ca.cwds.data.legacy.cms.entity.Client in project api-core by ca-cwds.
the class ClientDao method findSingleFacility.
private Client findSingleFacility(String queryName, Consumer<Query<Client>> setParameters) {
Session session = getSessionFactory().getCurrentSession();
Class<Client> entityClass = getEntityClass();
Query<Client> query = session.createNamedQuery(entityClass.getSimpleName() + "." + queryName, entityClass);
setParameters.accept(query);
query.setMaxResults(1);
Client client = null;
try {
client = query.getSingleResult();
} catch (NoResultException e) {
LOG.debug(e.getMessage(), e);
}
return client;
}
use of gov.ca.cwds.data.legacy.cms.entity.Client in project api-core by ca-cwds.
the class R00742Test method testOtherEthnicityPresentWhenNoPrimary.
@Test
public void testOtherEthnicityPresentWhenNoPrimary() throws Exception {
Client client = new Client();
client.setIdentifier(CLIENT_IDENTIFIER);
client.setPrimaryEthnicityCode((short) 0);
clientEntityAwareDTO.setEntity(client);
List<ClientOtherEthnicity> clientScpEthnicityList = createListOfDifferentClientOtherEthnicities(client);
clientEntityAwareDTO.getOtherEthnicities().addAll(clientScpEthnicityList);
checkRuleViolatedOnce(RULE_NAME);
}
use of gov.ca.cwds.data.legacy.cms.entity.Client in project api-core by ca-cwds.
the class R00742Test method testNoPrimaryValidListOfOther.
@Test
public void testNoPrimaryValidListOfOther() throws Exception {
Client client = new Client();
client.setIdentifier(CLIENT_IDENTIFIER);
client.setPrimaryEthnicityCode((short) 0);
clientEntityAwareDTO.setEntity(client);
clientEntityAwareDTO.getOtherEthnicities().add(createClientOtherEthnicity(client, (short) 0));
clientEntityAwareDTO.getOtherEthnicities().add(createClientOtherEthnicity(client, (short) 0));
checkRuleSatisfied(RULE_NAME);
}
Aggregations