Search in sources :

Example 6 with AllegationPerpetratorHistory

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

the class AllegationPerpetratorHistoryDaoIT method testUpdate.

@Override
@Test
public void testUpdate() throws Exception {
    gov.ca.cwds.rest.api.domain.cms.AllegationPerpetratorHistory vdaph = validDomainAllegationPerpetratorHistory();
    AllegationPerpetratorHistory allegationPerpetratorHistory = new AllegationPerpetratorHistory(id, vdaph.getCountySpecificCode(), vdaph.getVictimClientId(), vdaph.getAllegationId(), DomainChef.uncookDateString(vdaph.getPerpetratorUpdateDate()));
    AllegationPerpetratorHistory updated = allegationPerpetratorHistoryDao.update(allegationPerpetratorHistory);
    assertThat(allegationPerpetratorHistory, is(updated));
}
Also used : AllegationPerpetratorHistory(gov.ca.cwds.data.persistence.cms.AllegationPerpetratorHistory) Test(org.junit.Test)

Example 7 with AllegationPerpetratorHistory

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

the class AllegationPerpetratorHistoryDaoIT method testUpdateEntityNotFoundException.

@Override
@Test
public void testUpdateEntityNotFoundException() throws Exception {
    thrown.expect(EntityNotFoundException.class);
    gov.ca.cwds.rest.api.domain.cms.AllegationPerpetratorHistory vdaph = validDomainAllegationPerpetratorHistory();
    AllegationPerpetratorHistory allegationPerpetratorHistory = new AllegationPerpetratorHistory("1234567ABC", vdaph.getCountySpecificCode(), vdaph.getVictimClientId(), vdaph.getAllegationId(), DomainChef.uncookDateString(vdaph.getPerpetratorUpdateDate()));
    allegationPerpetratorHistoryDao.update(allegationPerpetratorHistory);
}
Also used : AllegationPerpetratorHistory(gov.ca.cwds.data.persistence.cms.AllegationPerpetratorHistory) Test(org.junit.Test)

Example 8 with AllegationPerpetratorHistory

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

the class AllegationPerpetratorHistoryDaoIT method testDeleteEntityNotFoundException.

@Override
@Test
public void testDeleteEntityNotFoundException() throws Exception {
    AllegationPerpetratorHistory deleted = allegationPerpetratorHistoryDao.delete("9999999ZZZ");
    assertThat(deleted, is(nullValue()));
}
Also used : AllegationPerpetratorHistory(gov.ca.cwds.data.persistence.cms.AllegationPerpetratorHistory) Test(org.junit.Test)

Example 9 with AllegationPerpetratorHistory

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

the class AllegationPerpetratorHistoryDaoIT method testCreateExistingEntityException.

@Override
@Test
public void testCreateExistingEntityException() throws Exception {
    thrown.expect(EntityExistsException.class);
    gov.ca.cwds.rest.api.domain.cms.AllegationPerpetratorHistory vdaph = validDomainAllegationPerpetratorHistory();
    AllegationPerpetratorHistory allegationPerpetratorHistory = new AllegationPerpetratorHistory(id, vdaph.getCountySpecificCode(), vdaph.getVictimClientId(), vdaph.getAllegationId(), DomainChef.uncookDateString(vdaph.getPerpetratorUpdateDate()));
    allegationPerpetratorHistoryDao.create(allegationPerpetratorHistory);
}
Also used : AllegationPerpetratorHistory(gov.ca.cwds.data.persistence.cms.AllegationPerpetratorHistory) Test(org.junit.Test)

Example 10 with AllegationPerpetratorHistory

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

the class AllegationPerpetratorHistoryDaoIT method testFind.

/**
   * Find JUnit test
   */
@Override
@Test
public void testFind() throws Exception {
    AllegationPerpetratorHistory found = allegationPerpetratorHistoryDao.find(id);
    assertThat(found.getId(), is(equalTo(id)));
}
Also used : AllegationPerpetratorHistory(gov.ca.cwds.data.persistence.cms.AllegationPerpetratorHistory) Test(org.junit.Test)

Aggregations

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