Search in sources :

Example 11 with ReferralClient

use of gov.ca.cwds.data.persistence.cms.ReferralClient in project API by ca-cwds.

the class ReferralClientDaoIT method testDeleteEntityNotFoundException.

@Override
@Test
public void testDeleteEntityNotFoundException() throws Exception {
    ReferralClient delete = referralClientDao.delete(new PrimaryKey("ZZZZZZZ999", "XXXXXXX000"));
    assertThat(delete, is(nullValue()));
}
Also used : PrimaryKey(gov.ca.cwds.data.persistence.cms.ReferralClient.PrimaryKey) ReferralClient(gov.ca.cwds.data.persistence.cms.ReferralClient) Test(org.junit.Test)

Example 12 with ReferralClient

use of gov.ca.cwds.data.persistence.cms.ReferralClient in project API by ca-cwds.

the class ReferralClientDaoIT method testCreate.

@Override
@Test
public void testCreate() throws Exception {
    ReferralClient referralClient = new ReferralClient("86XV1bG06k", "AazXkWY06k", "", (short) 122, (short) 681, "S", null, "N", "N", "", (short) 2, "", "", "Y", "N", "N");
    ReferralClient created = referralClientDao.create(referralClient);
    assertThat(created, is(referralClient));
}
Also used : ReferralClient(gov.ca.cwds.data.persistence.cms.ReferralClient) Test(org.junit.Test)

Example 13 with ReferralClient

use of gov.ca.cwds.data.persistence.cms.ReferralClient in project API by ca-cwds.

the class ReferralClientDaoIT method testFind.

@Override
@Test
public void testFind() throws Exception {
    ReferralClient found = referralClientDao.find(new PrimaryKey("LNuzMKw06s", "AazXkWY06s"));
    assertThat(found, is(notNullValue()));
    assertThat(found.getReferralId(), is(equalTo("LNuzMKw06s")));
    assertThat(found.getClientId(), is(equalTo("AazXkWY06s")));
}
Also used : PrimaryKey(gov.ca.cwds.data.persistence.cms.ReferralClient.PrimaryKey) ReferralClient(gov.ca.cwds.data.persistence.cms.ReferralClient) Test(org.junit.Test)

Aggregations

ReferralClient (gov.ca.cwds.data.persistence.cms.ReferralClient)13 Test (org.junit.Test)10 PrimaryKey (gov.ca.cwds.data.persistence.cms.ReferralClient.PrimaryKey)4 CountyTrigger (gov.ca.cwds.data.persistence.cms.CountyTrigger)3 StaffPerson (gov.ca.cwds.data.persistence.cms.StaffPerson)2 ServiceException (gov.ca.cwds.rest.services.ServiceException)2 InvocationOnMock (org.mockito.invocation.InvocationOnMock)2 Referral (gov.ca.cwds.data.persistence.cms.Referral)1 EntityExistsException (javax.persistence.EntityExistsException)1 EntityNotFoundException (javax.persistence.EntityNotFoundException)1