use of org.folio.rest.jaxrs.model.TitlePostRequest 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.TitlePostRequest in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldThrowExceptionWhenNoPostData.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionWhenNoPostData() {
TitlePostRequest postRequest = new TitlePostRequest().withData(null);
validator.validate(postRequest);
}
use of org.folio.rest.jaxrs.model.TitlePostRequest 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.TitlePostRequest 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);
}
use of org.folio.rest.jaxrs.model.TitlePostRequest in project mod-kb-ebsco-java by folio-org.
the class TitlePostBodyValidatorTest method shouldNotThrowExceptionIfTitlePublisherNameIsNull.
@Test
public void shouldNotThrowExceptionIfTitlePublisherNameIsNull() {
TitlePostRequest titlePostRequest = createRequest(new TitlePostDataAttributes().withName(TITLE_TEST_NAME).withPublicationType(PublicationType.BOOK).withPublisherName(null));
validator.validate(titlePostRequest);
}
Aggregations