use of gov.ca.cwds.rest.api.Response in project API by ca-cwds.
the class ReporterServiceTest method createReturnsPostedReporterClass.
@SuppressWarnings("javadoc")
@Test
public void createReturnsPostedReporterClass() throws Exception {
Reporter reporterDomain = MAPPER.readValue(fixture("fixtures/domain/legacy/Reporter/valid/valid.json"), Reporter.class);
gov.ca.cwds.data.persistence.cms.Reporter toCreate = new gov.ca.cwds.data.persistence.cms.Reporter(reporterDomain, "last_update");
Reporter request = new Reporter(toCreate);
when(reporterDao.create(any(gov.ca.cwds.data.persistence.cms.Reporter.class))).thenReturn(toCreate);
Response response = reporterService.create(request);
assertThat(response.getClass(), is(PostedReporter.class));
}
use of gov.ca.cwds.rest.api.Response in project API by ca-cwds.
the class ClientServiceTest method testDeleteReturnsNullWhenNotFound.
@Override
@Test
public void testDeleteReturnsNullWhenNotFound() throws Exception {
Response found = clientService.delete("ABC1234567");
assertThat(found, is(nullValue()));
}
use of gov.ca.cwds.rest.api.Response in project API by ca-cwds.
the class ReferralClientServiceTest method deleteReturnsNullWhenNotFound.
// delete test
@SuppressWarnings("javadoc")
@Test
public void deleteReturnsNullWhenNotFound() throws Exception {
Response found = referralClientService.delete("referralId=1234567ABC,clientId=ABC1234567");
assertThat(found, is(nullValue()));
}
use of gov.ca.cwds.rest.api.Response in project API by ca-cwds.
the class ClientServiceTest method testCreateReturnsPostedClass.
// create test
@Override
@Test
public void testCreateReturnsPostedClass() throws Exception {
String id = "Aaeae9r0F4";
Client clientDomain = MAPPER.readValue(fixture("fixtures/domain/legacy/Client/valid/serviceValid.json"), Client.class);
gov.ca.cwds.data.persistence.cms.Client toCreate = new gov.ca.cwds.data.persistence.cms.Client(id, clientDomain, "q1p");
Client request = new Client(toCreate, false);
when(clientDao.create(any(gov.ca.cwds.data.persistence.cms.Client.class))).thenReturn(toCreate);
Response response = clientService.create(request);
assertThat(response.getClass(), is(PostedClient.class));
}
use of gov.ca.cwds.rest.api.Response in project API by ca-cwds.
the class LongTextServiceTest method testFindReturnsNullWhenNotFound.
@Override
@Test
public void testFindReturnsNullWhenNotFound() throws Exception {
Response found = longTextService.find("ABC1234567");
assertThat(found, is(nullValue()));
}
Aggregations