Search in sources :

Example 51 with Response

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));
}
Also used : Response(gov.ca.cwds.rest.api.Response) PostedReporter(gov.ca.cwds.rest.api.domain.cms.PostedReporter) Reporter(gov.ca.cwds.rest.api.domain.cms.Reporter) PostedReporter(gov.ca.cwds.rest.api.domain.cms.PostedReporter) Test(org.junit.Test)

Example 52 with Response

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()));
}
Also used : Response(gov.ca.cwds.rest.api.Response) Test(org.junit.Test)

Example 53 with Response

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()));
}
Also used : Response(gov.ca.cwds.rest.api.Response) Test(org.junit.Test)

Example 54 with Response

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));
}
Also used : Response(gov.ca.cwds.rest.api.Response) PostedClient(gov.ca.cwds.rest.api.domain.cms.PostedClient) Client(gov.ca.cwds.rest.api.domain.cms.Client) PostedClient(gov.ca.cwds.rest.api.domain.cms.PostedClient) Test(org.junit.Test)

Example 55 with Response

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()));
}
Also used : Response(gov.ca.cwds.rest.api.Response) Test(org.junit.Test)

Aggregations

Response (gov.ca.cwds.rest.api.Response)83 Test (org.junit.Test)80 ReferralClient (gov.ca.cwds.rest.api.domain.cms.ReferralClient)46 CrossReport (gov.ca.cwds.rest.api.domain.cms.CrossReport)45 Allegation (gov.ca.cwds.rest.api.domain.cms.Allegation)44 Client (gov.ca.cwds.rest.api.domain.cms.Client)44 Referral (gov.ca.cwds.rest.api.domain.cms.Referral)44 PostedScreeningToReferral (gov.ca.cwds.rest.api.domain.PostedScreeningToReferral)43 ChildClient (gov.ca.cwds.rest.api.domain.cms.ChildClient)43 CmsReferral (gov.ca.cwds.rest.api.domain.cms.CmsReferral)43 LongText (gov.ca.cwds.rest.api.domain.cms.LongText)43 Reporter (gov.ca.cwds.rest.api.domain.cms.Reporter)43 LinkedHashSet (java.util.LinkedHashSet)43 Set (java.util.Set)43 ScreeningToReferral (gov.ca.cwds.rest.api.domain.ScreeningToReferral)42 Address (gov.ca.cwds.rest.api.domain.cms.Address)42 ClientAddress (gov.ca.cwds.rest.api.domain.cms.ClientAddress)42 ErrorMessage (gov.ca.cwds.rest.api.domain.error.ErrorMessage)22 ExpectedException (org.junit.rules.ExpectedException)16 PostedCmsReferral (gov.ca.cwds.rest.api.domain.cms.PostedCmsReferral)3