use of gov.ca.cwds.rest.api.domain.cms.PostedAllegationPerpetratorHistory in project API by ca-cwds.
the class AllegationPerpetratorHistoryServiceTest method testCreateNullIDError.
@Override
@Test
public void testCreateNullIDError() throws Exception {
try {
AllegationPerpetratorHistory allegationPerpetratorHistoryDomain = MAPPER.readValue(fixture("fixtures/domain/legacy/AllegationPerpetratorHistory/valid/valid.json"), AllegationPerpetratorHistory.class);
gov.ca.cwds.data.persistence.cms.AllegationPerpetratorHistory toCreate = new gov.ca.cwds.data.persistence.cms.AllegationPerpetratorHistory(null, allegationPerpetratorHistoryDomain, "ABC");
when(allegationPerpetratorHistoryDao.create(any(gov.ca.cwds.data.persistence.cms.AllegationPerpetratorHistory.class))).thenReturn(toCreate);
PostedAllegationPerpetratorHistory expected = new PostedAllegationPerpetratorHistory(toCreate);
} catch (ServiceException e) {
assertEquals("AllegationPerpetratorHistory ID cannot be blank", e.getMessage());
}
}
Aggregations