use of gov.ca.cwds.data.persistence.cms.ClientUc in project API by ca-cwds.
the class ClientUcDaoIT method testFindEntityNotFoundException.
@Override
@Test
public void testFindEntityNotFoundException() throws Exception {
ClientUc found = clientUcDao.find("9999999ZZZ");
assertThat(found, is(nullValue()));
}
use of gov.ca.cwds.data.persistence.cms.ClientUc in project API by ca-cwds.
the class ClientUcService method update.
/**
* {@inheritDoc}
*
* @see gov.ca.cwds.rest.services.CrudsService#update(java.io.Serializable,
* gov.ca.cwds.rest.api.Request)
*/
@Override
public gov.ca.cwds.rest.api.domain.cms.ClientUc update(Serializable primaryKey, Request request) {
assert request instanceof gov.ca.cwds.rest.api.domain.cms.ClientUc;
gov.ca.cwds.rest.api.domain.cms.ClientUc clientUc = (gov.ca.cwds.rest.api.domain.cms.ClientUc) request;
try {
String lastUpdatedId = staffPersonIdRetriever.getStaffPersonId();
ClientUc managed = new ClientUc(clientUc, lastUpdatedId);
managed = clientucDao.update(managed);
return new gov.ca.cwds.rest.api.domain.cms.ClientUc(managed);
} catch (EntityNotFoundException e) {
LOGGER.info("Client not found : {}", clientUc);
throw new ServiceException(e);
}
}
use of gov.ca.cwds.data.persistence.cms.ClientUc in project API by ca-cwds.
the class ClientUcService method create.
/**
* {@inheritDoc}
*
* @see gov.ca.cwds.rest.services.CrudsService#create(gov.ca.cwds.rest.api.Request)
*/
@Override
public gov.ca.cwds.rest.api.domain.cms.ClientUc create(Request request) {
assert request instanceof gov.ca.cwds.rest.api.domain.cms.ClientUc;
gov.ca.cwds.rest.api.domain.cms.ClientUc clientUc = (gov.ca.cwds.rest.api.domain.cms.ClientUc) request;
try {
String lastUpdatedId = staffPersonIdRetriever.getStaffPersonId();
ClientUc managed = new ClientUc(clientUc, lastUpdatedId);
// NOSONAR
managed = clientucDao.create(managed);
return mockDomain;
} catch (EntityExistsException e) {
LOGGER.info("Client already exists : {}", clientUc);
throw new ServiceException(e);
}
}
use of gov.ca.cwds.data.persistence.cms.ClientUc in project API by ca-cwds.
the class ClientUcDaoIT method testUpdateEntityNotFoundException.
@Override
@Test
public void testUpdateEntityNotFoundException() throws Exception {
thrown.expect(EntityNotFoundException.class);
gov.ca.cwds.rest.api.domain.cms.ClientUc vcluc = validDomainClientUc();
ClientUc clientUc = new ClientUc("ABC1234567", vcluc.getSourceTableCode(), vcluc.getCommonFirstName(), vcluc.getCommonLastName(), vcluc.getCommonMiddleName());
clientUcDao.update(clientUc);
}
use of gov.ca.cwds.data.persistence.cms.ClientUc in project API by ca-cwds.
the class ClientUcDaoIT method testCreate.
/**
* Create JUnit test
*/
@Override
@Test
public void testCreate() throws Exception {
gov.ca.cwds.rest.api.domain.cms.ClientUc vcluc = validDomainClientUc();
ClientUc clientUc = new ClientUc("ABC1234567", vcluc.getSourceTableCode(), vcluc.getCommonFirstName(), vcluc.getCommonLastName(), vcluc.getCommonMiddleName());
ClientUc create = clientUcDao.create(clientUc);
assertThat(clientUc, is(create));
}
Aggregations