Search in sources :

Example 6 with LongText

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

the class LongTextDaoIT method testCreateExistingEntityException.

@Override
@Test
public void testCreateExistingEntityException() throws Exception {
    thrown.expect(EntityExistsException.class);
    gov.ca.cwds.rest.api.domain.cms.LongText vdlt = validDomainLongText();
    LongText longText = new LongText(id, vdlt.getCountySpecificCode(), vdlt.getTextDescription());
    longTextDao.create(longText);
}
Also used : LongText(gov.ca.cwds.data.persistence.cms.LongText) Test(org.junit.Test)

Example 7 with LongText

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

the class LongTextDaoIT method testFindEntityNotFoundException.

@Override
@Test
public void testFindEntityNotFoundException() throws Exception {
    LongText found = longTextDao.find("9999999ZZZ");
    assertThat(found, is(nullValue()));
}
Also used : LongText(gov.ca.cwds.data.persistence.cms.LongText) Test(org.junit.Test)

Example 8 with LongText

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

the class LongTextDaoIT method testCreate.

/**
   * Create JUnit test
   */
@Override
@Test
public void testCreate() throws Exception {
    gov.ca.cwds.rest.api.domain.cms.LongText vdlt = validDomainLongText();
    LongText longText = new LongText("ABC1234567", vdlt.getCountySpecificCode(), vdlt.getTextDescription());
    LongText create = longTextDao.create(longText);
    assertThat(longText, is(create));
}
Also used : LongText(gov.ca.cwds.data.persistence.cms.LongText) Test(org.junit.Test)

Example 9 with LongText

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

the class LongTextDaoIT method testFind.

@Override
@Test
public void testFind() throws Exception {
    LongText found = longTextDao.find(id);
    assertThat(found.getId(), is(equalTo(id)));
}
Also used : LongText(gov.ca.cwds.data.persistence.cms.LongText) Test(org.junit.Test)

Example 10 with LongText

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

the class LongTextDaoIT method testUpdate.

@Override
@Test
public void testUpdate() throws Exception {
    gov.ca.cwds.rest.api.domain.cms.LongText vdlt = validDomainLongText();
    LongText longText = new LongText(id, vdlt.getCountySpecificCode(), vdlt.getTextDescription());
    LongText updated = longTextDao.update(longText);
    assertThat(longText, is(updated));
}
Also used : LongText(gov.ca.cwds.data.persistence.cms.LongText) Test(org.junit.Test)

Aggregations

LongText (gov.ca.cwds.data.persistence.cms.LongText)10 Test (org.junit.Test)8 PostedLongText (gov.ca.cwds.rest.api.domain.cms.PostedLongText)2 ServiceException (gov.ca.cwds.rest.services.ServiceException)2 EntityExistsException (javax.persistence.EntityExistsException)1 EntityNotFoundException (javax.persistence.EntityNotFoundException)1