use of org.folio.rest.jaxrs.model.Coverage 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.Coverage 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.Coverage 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.Coverage in project mod-kb-ebsco-java by folio-org.
the class PackagePostValidatorTest method shouldThrowExceptionWhenPostDataAttributeCustomCoverageBeginDateIsNull.
@Test(expected = InputValidationException.class)
public void shouldThrowExceptionWhenPostDataAttributeCustomCoverageBeginDateIsNull() {
PackagePostRequest postRequest = new PackagePostRequest().withData(new PackagePostData().withAttributes(new PackagePostDataAttributes().withName("name").withContentType(ContentType.STREAMING_MEDIA).withCustomCoverage(new Coverage())));
validator.validate(postRequest);
}
use of org.folio.rest.jaxrs.model.Coverage in project mod-kb-ebsco-java by folio-org.
the class PackagePostValidatorTest method shouldNotThrowExceptionWhenPostDataAttributeCustomCoverageBeginDateIsEmpty.
@Test
public void shouldNotThrowExceptionWhenPostDataAttributeCustomCoverageBeginDateIsEmpty() {
PackagePostRequest postRequest = new PackagePostRequest().withData(new PackagePostData().withAttributes(new PackagePostDataAttributes().withName("name").withContentType(ContentType.STREAMING_MEDIA).withCustomCoverage(new Coverage().withBeginCoverage(""))));
validator.validate(postRequest);
}
Aggregations