use of org.folio.rest.jaxrs.model.TitlePostRequest in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldNotThrowExceptionIfTitleEditionIsEmpty.
@Test
public void shouldNotThrowExceptionIfTitleEditionIsEmpty() {
TitlePostRequest titlePostRequest = createRequest(new TitlePostDataAttributes().withName(TITLE_TEST_NAME).withPublicationType(PublicationType.BOOK).withEdition(""));
validator.validate(titlePostRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostRequest in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldThrowExceptionIfTitleNameIsTooLong.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionIfTitleNameIsTooLong() {
TitlePostRequest titlePostRequest = new TitlePostRequest();
titlePostRequest.withData(new TitlePostData().withAttributes(new TitlePostDataAttributes().withName(TEXT_LONGER_THAN_400_CHARACTERS)));
validator.validate(titlePostRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostRequest in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldThrowExceptionIfTitleDescriptionIsTooLong.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionIfTitleDescriptionIsTooLong() {
TitlePostRequest titlePostRequest = new TitlePostRequest();
titlePostRequest.withData(new TitlePostData().withAttributes(new TitlePostDataAttributes().withName(TITLE_TEST_NAME).withDescription(TEXT_LONGER_THAN_1500_CHARACTERS)));
validator.validate(titlePostRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostRequest in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldThrowExceptionIfTitleNameIsNull.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionIfTitleNameIsNull() {
TitlePostRequest titlePostRequest = new TitlePostRequest();
titlePostRequest.withData(new TitlePostData().withAttributes(new TitlePostDataAttributes().withName(null)));
validator.validate(titlePostRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostRequest in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldThrowExceptionWhenNoPostBody.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionWhenNoPostBody() {
TitlePostRequest postRequest = null;
validator.validate(postRequest);
}
Aggregations