use of org.folio.rest.jaxrs.model.TitlePostData in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldThrowExceptionIfTitleNameIsEmpty.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionIfTitleNameIsEmpty() {
TitlePostRequest titlePostRequest = new TitlePostRequest();
titlePostRequest.withData(new TitlePostData().withAttributes(new TitlePostDataAttributes().withName("")));
validator.validate(titlePostRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostData in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method createRequest.
private TitlePostRequest createRequest(TitlePostDataAttributes attributes) {
TitlePostRequest titlePostRequest = new TitlePostRequest();
titlePostRequest.withData(new TitlePostData().withAttributes(attributes)).withIncluded(getTitlePostIncluded());
return titlePostRequest;
}
use of org.folio.rest.jaxrs.model.TitlePostData in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldThrowExceptionWhenEmptyPostData.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionWhenEmptyPostData() {
TitlePostRequest postRequest = new TitlePostRequest().withData(new TitlePostData());
validator.validate(postRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostData in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldThrowExceptionIfTitlePublisherNameIsTooLong.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionIfTitlePublisherNameIsTooLong() {
TitlePostRequest titlePostRequest = new TitlePostRequest();
titlePostRequest.withData(new TitlePostData().withAttributes(new TitlePostDataAttributes().withName(TITLE_TEST_NAME).withPublisherName(TEXT_LONGER_THAN_250_CHARACTERS)));
validator.validate(titlePostRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostData in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldThrowExceptionIfTitleIdentifierIdTooLong.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionIfTitleIdentifierIdTooLong() {
TitlePostRequest titlePostRequest = new TitlePostRequest();
List<Identifier> titleIdentifiers = new ArrayList<>();
titleIdentifiers.add(new Identifier().withId("1234567-1234567-1234567"));
titlePostRequest.withData(new TitlePostData().withAttributes(new TitlePostDataAttributes().withName(TITLE_TEST_NAME).withPublisherName("Test publisher name").withIdentifiers(titleIdentifiers)));
validator.validate(titlePostRequest);
}
Aggregations