Search in sources :

Example 16 with TitlePostRequest

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

Example 17 with 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);
}
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 18 with 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);
}
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 19 with 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);
}
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 20 with 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);
}
Also used : TitlePostRequest(org.folio.rest.jaxrs.model.TitlePostRequest) Test(org.junit.Test)

Aggregations

TitlePostRequest (org.folio.rest.jaxrs.model.TitlePostRequest)21 Test (org.junit.Test)18 TitlePostDataAttributes (org.folio.rest.jaxrs.model.TitlePostDataAttributes)14 TitlePostData (org.folio.rest.jaxrs.model.TitlePostData)8 Tags (org.folio.rest.jaxrs.model.Tags)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ResponseDefinitionBuilder (com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder)1 EqualToJsonPattern (com.github.tomakehurst.wiremock.matching.EqualToJsonPattern)1 EqualToPattern (com.github.tomakehurst.wiremock.matching.EqualToPattern)1 RegexPattern (com.github.tomakehurst.wiremock.matching.RegexPattern)1 UrlPathPattern (com.github.tomakehurst.wiremock.matching.UrlPathPattern)1 AsyncResult (io.vertx.core.AsyncResult)1 Context (io.vertx.core.Context)1 Handler (io.vertx.core.Handler)1 Vertx (io.vertx.core.Vertx)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 UUID (java.util.UUID)1