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 ClientUcDaoIT method testDeleteEntityNotFoundException.
@Override
@Test
public void testDeleteEntityNotFoundException() throws Exception {
ClientUc deleted = clientUcDao.delete("9999999ZZZ");
assertThat(deleted, is(nullValue()));
}
use of gov.ca.cwds.data.persistence.cms.ClientUc in project API by ca-cwds.
the class ClientUcDaoIT method testCreateExistingEntityException.
@Override
@Test
public void testCreateExistingEntityException() throws Exception {
thrown.expect(EntityExistsException.class);
gov.ca.cwds.rest.api.domain.cms.ClientUc vcluc = validDomainClientUc();
ClientUc clientUc = new ClientUc(id, vcluc.getSourceTableCode(), vcluc.getCommonFirstName(), vcluc.getCommonLastName(), vcluc.getCommonMiddleName());
clientUcDao.create(clientUc);
}
use of gov.ca.cwds.data.persistence.cms.ClientUc in project API by ca-cwds.
the class ClientUcDaoIT method testUpdate.
@Override
@Test
public void testUpdate() throws Exception {
gov.ca.cwds.rest.api.domain.cms.ClientUc vcluc = validDomainClientUc();
ClientUc clientUc = new ClientUc(id, vcluc.getSourceTableCode(), vcluc.getCommonFirstName(), vcluc.getCommonLastName(), vcluc.getCommonMiddleName());
ClientUc updated = clientUcDao.update(clientUc);
assertThat(clientUc, is(updated));
}
use of gov.ca.cwds.data.persistence.cms.ClientUc in project API by ca-cwds.
the class ClientUcDaoIT method testFind.
@Override
@Test
public void testFind() throws Exception {
ClientUc found = clientUcDao.find(id);
assertThat(found.getPktableId(), is(equalTo(id)));
}
Aggregations