Search in sources :

Example 6 with Reporter

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

the class ReporterDaoIT method testFindEntityNotFoundException.

@Override
@Test
public void testFindEntityNotFoundException() throws Exception {
    String id = "ZZZZZZZ999";
    Reporter found = reporterDao.find(id);
    assertThat(found, is(nullValue()));
}
Also used : Reporter(gov.ca.cwds.data.persistence.cms.Reporter) Test(org.junit.Test)

Example 7 with Reporter

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

the class ReporterDaoIT method testUpdateEntityNotFoundException.

@Override
@Test
public void testUpdateEntityNotFoundException() throws Exception {
    thrown.expect(EntityNotFoundException.class);
    Reporter reporter = new Reporter("ZZZZZZ", "  ", "City", (short) 591, (short) 0, "N", null, " ", null, "N", "Fred", "Reporter", "N", 0, BigDecimal.valueOf(0), " ", " ", BigDecimal.valueOf(0L), 0, (short) 1828, "Street", "12345", " ", new Integer(95845), "AbiQCgu0Hk", (short) 0, "51");
    reporterDao.update(reporter);
}
Also used : Reporter(gov.ca.cwds.data.persistence.cms.Reporter) Test(org.junit.Test)

Example 8 with Reporter

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

the class ReporterDaoIT method testCreate.

@Override
@Test
public void testCreate() throws Exception {
    Reporter reporter = new Reporter("AbiQCgu0AA", "  ", "City", (short) 591, (short) 0, "N", null, " ", null, "N", "Fred", "Reporter", "N", 0, BigDecimal.valueOf(0), " ", " ", BigDecimal.valueOf(0L), 0, (short) 1828, "Street", "12345", " ", new Integer(95845), "AbiQCgu0Hk", (short) 0, "51");
    Reporter created = reporterDao.create(reporter);
    assertThat(created, is(reporter));
}
Also used : Reporter(gov.ca.cwds.data.persistence.cms.Reporter) Test(org.junit.Test)

Example 9 with Reporter

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

the class ReporterDaoIT method testFind.

@Override
@Test
public void testFind() throws Exception {
    String id = "AbiQCgu0Hj";
    Reporter found = reporterDao.find(id);
    assertThat(found.getReferralId(), is(id));
}
Also used : Reporter(gov.ca.cwds.data.persistence.cms.Reporter) Test(org.junit.Test)

Example 10 with Reporter

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

the class ReporterDaoIT method testCreateExistingEntityException.

@Override
@Test
public void testCreateExistingEntityException() throws Exception {
    thrown.expect(EntityExistsException.class);
    Reporter reporter = new Reporter("AbiQCgu0Hj", "  ", "City", (short) 591, (short) 0, "N", null, " ", null, "N", "Fred", "Reporter", "N", 0, BigDecimal.valueOf(0), " ", " ", BigDecimal.valueOf(0L), 0, (short) 1828, "Street", "12345", " ", new Integer(95845), "AbiQCgu0Hk", (short) 0, "51");
    reporterDao.create(reporter);
}
Also used : Reporter(gov.ca.cwds.data.persistence.cms.Reporter) Test(org.junit.Test)

Aggregations

Reporter (gov.ca.cwds.data.persistence.cms.Reporter)11 Test (org.junit.Test)9 PostedReporter (gov.ca.cwds.rest.api.domain.cms.PostedReporter)2 ServiceException (gov.ca.cwds.rest.services.ServiceException)2 EntityExistsException (javax.persistence.EntityExistsException)1 EntityNotFoundException (javax.persistence.EntityNotFoundException)1 Query (org.hibernate.Query)1