Search in sources :

Example 1 with TitlePostDataAttributes

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);
}
Also used : TitlePostRequest(org.folio.rest.jaxrs.model.TitlePostRequest) TitlePostDataAttributes(org.folio.rest.jaxrs.model.TitlePostDataAttributes) Test(org.junit.Test)

Example 2 with TitlePostDataAttributes

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);
}
Also used : TitlePostRequest(org.folio.rest.jaxrs.model.TitlePostRequest) TitlePostDataAttributes(org.folio.rest.jaxrs.model.TitlePostDataAttributes) Test(org.junit.Test)

Example 3 with TitlePostDataAttributes

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);
}
Also used : TitlePostRequest(org.folio.rest.jaxrs.model.TitlePostRequest) TitlePostData(org.folio.rest.jaxrs.model.TitlePostData) TitlePostDataAttributes(org.folio.rest.jaxrs.model.TitlePostDataAttributes) Test(org.junit.Test)

Example 4 with TitlePostDataAttributes

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);
}
Also used : TitlePostRequest(org.folio.rest.jaxrs.model.TitlePostRequest) TitlePostDataAttributes(org.folio.rest.jaxrs.model.TitlePostDataAttributes) Test(org.junit.Test)

Example 5 with TitlePostDataAttributes

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);
}
Also used : TitlePostRequest(org.folio.rest.jaxrs.model.TitlePostRequest) TitlePostDataAttributes(org.folio.rest.jaxrs.model.TitlePostDataAttributes) Test(org.junit.Test)

Aggregations

TitlePostDataAttributes (org.folio.rest.jaxrs.model.TitlePostDataAttributes)16 TitlePostRequest (org.folio.rest.jaxrs.model.TitlePostRequest)14 Test (org.junit.Test)14 TitlePostData (org.folio.rest.jaxrs.model.TitlePostData)6 ArrayList (java.util.ArrayList)1 Identifier (org.folio.holdingsiq.model.Identifier)1 TitlePost (org.folio.holdingsiq.model.TitlePost)1 InputValidationException (org.folio.rest.exception.InputValidationException)1 Contributors (org.folio.rest.jaxrs.model.Contributors)1 Identifier (org.folio.rest.jaxrs.model.Identifier)1 TitlePostIncluded (org.folio.rest.jaxrs.model.TitlePostIncluded)1