Search in sources :

Example 41 with Response

use of gov.ca.cwds.rest.api.Response in project API by ca-cwds.

the class LongTextServiceTest method testDeleteReturnsNullWhenNotFound.

@Override
@Test
public void testDeleteReturnsNullWhenNotFound() throws Exception {
    Response found = longTextService.delete("ABC1234567");
    assertThat(found, is(nullValue()));
}
Also used : Response(gov.ca.cwds.rest.api.Response) Test(org.junit.Test)

Example 42 with Response

use of gov.ca.cwds.rest.api.Response in project API by ca-cwds.

the class ClientServiceTest method testFindReturnsNullWhenNotFound.

@Override
@Test
public void testFindReturnsNullWhenNotFound() throws Exception {
    Response found = clientService.find("ABC1234567");
    assertThat(found, is(nullValue()));
}
Also used : Response(gov.ca.cwds.rest.api.Response) Test(org.junit.Test)

Example 43 with Response

use of gov.ca.cwds.rest.api.Response in project API by ca-cwds.

the class CrossReportServiceTest method deleteReturnsNullWhenNotFount.

@SuppressWarnings("javadoc")
@Test
public void deleteReturnsNullWhenNotFount() throws Exception {
    Response found = crossReportService.delete("ABC1234567");
    assertThat(found, is(nullValue()));
}
Also used : Response(gov.ca.cwds.rest.api.Response) Test(org.junit.Test)

Example 44 with Response

use of gov.ca.cwds.rest.api.Response in project API by ca-cwds.

the class ReferralClientServiceTest method createReturnsPostedReferralClient.

@SuppressWarnings("javadoc")
@Test
public void createReturnsPostedReferralClient() throws Exception {
    ReferralClient referralClientDomain = MAPPER.readValue(fixture("fixtures/domain/legacy/ReferralClient/valid/valid.json"), ReferralClient.class);
    gov.ca.cwds.data.persistence.cms.ReferralClient toCreate = new gov.ca.cwds.data.persistence.cms.ReferralClient(referralClientDomain, "ABC");
    ReferralClient request = new ReferralClient(toCreate);
    when(referralClientDao.create(any(gov.ca.cwds.data.persistence.cms.ReferralClient.class))).thenReturn(toCreate);
    Response response = referralClientService.create(request);
    assertThat(response.getClass(), is(ReferralClient.class));
}
Also used : Response(gov.ca.cwds.rest.api.Response) ReferralClient(gov.ca.cwds.rest.api.domain.cms.ReferralClient) Test(org.junit.Test)

Example 45 with Response

use of gov.ca.cwds.rest.api.Response in project API by ca-cwds.

the class ReferralClientServiceTest method createReturnsPostedReferralClientClass.

@SuppressWarnings("javadoc")
@Test
public void createReturnsPostedReferralClientClass() throws Exception {
    ReferralClient referralClientDomain = MAPPER.readValue(fixture("fixtures/domain/legacy/ReferralClient/valid/valid.json"), ReferralClient.class);
    gov.ca.cwds.data.persistence.cms.ReferralClient toCreate = new gov.ca.cwds.data.persistence.cms.ReferralClient(referralClientDomain, "ABC");
    ReferralClient request = new ReferralClient(toCreate);
    when(referralClientDao.create(any(gov.ca.cwds.data.persistence.cms.ReferralClient.class))).thenReturn(toCreate);
    Response response = referralClientService.create(request);
    assertThat(response.getClass(), is(ReferralClient.class));
}
Also used : Response(gov.ca.cwds.rest.api.Response) ReferralClient(gov.ca.cwds.rest.api.domain.cms.ReferralClient) 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