use of org.folio.rest.jaxrs.model.PackagePostRequest in project mod-kb-ebsco-java by folio-org.
the class PackagePostValidatorTest method shouldThrowExceptionWhenPostDataAttributesNameIsEmpty.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionWhenPostDataAttributesNameIsEmpty() {
PackagePostRequest postRequest = new PackagePostRequest().withData(new PackagePostData().withAttributes(new PackagePostDataAttributes().withName("")));
validator.validate(postRequest);
}
use of org.folio.rest.jaxrs.model.PackagePostRequest in project mod-kb-ebsco-java by folio-org.
the class PackagePostValidatorTest method shouldThrowExceptionWhenPostDataAttributeCustomCoverageEndDateIsInvalidFormat.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionWhenPostDataAttributeCustomCoverageEndDateIsInvalidFormat() {
PackagePostRequest postRequest = new PackagePostRequest().withData(new PackagePostData().withAttributes(new PackagePostDataAttributes().withName("name").withContentType(ContentType.STREAMING_MEDIA).withCustomCoverage(new Coverage().withBeginCoverage("2003-11-01").withEndCoverage("-01"))));
validator.validate(postRequest);
}
use of org.folio.rest.jaxrs.model.PackagePostRequest in project mod-kb-ebsco-java by folio-org.
the class PackagePostValidatorTest method shouldThrowExceptionWhenPostDataAttributeCustomCoverageBeginDateIsInvalidFormat.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionWhenPostDataAttributeCustomCoverageBeginDateIsInvalidFormat() {
PackagePostRequest postRequest = new PackagePostRequest().withData(new PackagePostData().withAttributes(new PackagePostDataAttributes().withName("name").withContentType(ContentType.STREAMING_MEDIA).withCustomCoverage(new Coverage().withBeginCoverage("-01"))));
validator.validate(postRequest);
}
use of org.folio.rest.jaxrs.model.PackagePostRequest in project mod-kb-ebsco-java by folio-org.
the class PackagePostValidatorTest method shouldNotThrowExceptionWhenPostDataAttributeCustomCoverageWithValidBeginDateAndEndDateIsNull.
@Test
public void shouldNotThrowExceptionWhenPostDataAttributeCustomCoverageWithValidBeginDateAndEndDateIsNull() {
PackagePostRequest postRequest = new PackagePostRequest().withData(new PackagePostData().withAttributes(new PackagePostDataAttributes().withName("name").withContentType(ContentType.STREAMING_MEDIA).withCustomCoverage(new Coverage().withBeginCoverage("2003-11-01").withEndCoverage(null))));
validator.validate(postRequest);
}
use of org.folio.rest.jaxrs.model.PackagePostRequest in project mod-kb-ebsco-java by folio-org.
the class PackagePostValidatorTest method shouldThrowExceptionWhenNoPostBody.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionWhenNoPostBody() {
PackagePostRequest postRequest = null;
validator.validate(postRequest);
}
Aggregations