use of gov.ca.cwds.rest.api.domain.cms.PostedLongText in project API by ca-cwds.
the class LongTextServiceTest method testCreateReturnsCorrectEntity.
@Override
@Test
public void testCreateReturnsCorrectEntity() throws Exception {
String id = "AaoDyiJq27";
LongText longTextDomain = MAPPER.readValue(fixture("fixtures/domain/legacy/LongText/valid/valid.json"), LongText.class);
gov.ca.cwds.data.persistence.cms.LongText toCreate = new gov.ca.cwds.data.persistence.cms.LongText(id, longTextDomain, "q27");
LongText request = new LongText(toCreate);
when(longTextDao.create(any(gov.ca.cwds.data.persistence.cms.LongText.class))).thenReturn(toCreate);
PostedLongText expected = new PostedLongText(toCreate);
PostedLongText returned = longTextService.create(request);
assertThat(returned, is(expected));
}
use of gov.ca.cwds.rest.api.domain.cms.PostedLongText in project API by ca-cwds.
the class ScreeningToReferralService method createLongText.
private String createLongText(String countySpecificCode, String textDescription, Set<ErrorMessage> messages) throws ServiceException {
LongText longText = new LongText(countySpecificCode, textDescription);
PostedLongText postedLongText = longTextService.create(longText);
buildErrors(messages, validator.validate(longText));
return postedLongText.getId();
}
Aggregations