use of org.folio.rest.jaxrs.model.TitlePostDataAttributes in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldNotThrowExceptionIfTitleDescriptionIsNull.
@Test
public void shouldNotThrowExceptionIfTitleDescriptionIsNull() {
TitlePostRequest titlePostRequest = createRequest(new TitlePostDataAttributes().withName(TITLE_TEST_NAME).withPublicationType(PublicationType.BOOK).withDescription(null));
validator.validate(titlePostRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostDataAttributes in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldNotThrowExceptionIfTitleDescriptionIsEmpty.
@Test
public void shouldNotThrowExceptionIfTitleDescriptionIsEmpty() {
TitlePostRequest titlePostRequest = createRequest(new TitlePostDataAttributes().withName(TITLE_TEST_NAME).withPublicationType(PublicationType.BOOK).withDescription(""));
validator.validate(titlePostRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostDataAttributes 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.TitlePostDataAttributes in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldThrowExceptionIfUserDefinedFieldIsTooLong.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionIfUserDefinedFieldIsTooLong() {
TitlePostRequest titlePostRequest = createRequest(new TitlePostDataAttributes().withName(TITLE_TEST_NAME).withUserDefinedField1(StringUtils.repeat("*", 101)).withPublicationType(PublicationType.BOOK));
validator.validate(titlePostRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostDataAttributes in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldNotThrowExceptionIfTitlePublisherNameIsEmpty.
@Test
public void shouldNotThrowExceptionIfTitlePublisherNameIsEmpty() {
TitlePostRequest titlePostRequest = createRequest(new TitlePostDataAttributes().withName(TITLE_TEST_NAME).withPublicationType(PublicationType.BOOK).withPublisherName(""));
validator.validate(titlePostRequest);
}
Aggregations