Search in sources :

Example 6 with Publication

use of org.folio.rest.jaxrs.model.Publication in project mod-inventory-storage by folio-org.

the class PublicationPeriodParserTest method shouldParseDateOfPublicationForMultiplePublications.

@Test
@Parameters({ "1990, null, 1990, null", "[1990], null, 1990, null", "©1990, null, 1990, null", "[1999?], null, 1999, null", "Cop 1990, null, 1990, null", "©2001, [2003], 2001, 2003", "©2001, [2001], 2001, null", "2001, 2003, 2001, 2003", "2001- 2003, null, 2001, 2003", "2003-2001, 2003, 2003, null", "2000-2010, 2012-2020, 2000, 2020", "null, 1999, null, 1999" })
public void shouldParseDateOfPublicationForMultiplePublications(@Nullable String dateOfPublicationFirst, @Nullable String dateOfPublicationLast, @Nullable Integer start, @Nullable Integer end) {
    var firstPublication = new Publication().withDateOfPublication(dateOfPublicationFirst);
    var lastPublication = new Publication().withDateOfPublication(dateOfPublicationLast);
    var publicationPeriod = parsePublicationPeriod(List.of(firstPublication, lastPublication));
    assertThat(publicationPeriod.getStart(), is(start));
    assertThat(publicationPeriod.getEnd(), is(end));
}
Also used : Publication(org.folio.rest.jaxrs.model.Publication) Parameters(junitparams.Parameters) Test(org.junit.Test)

Aggregations

Publication (org.folio.rest.jaxrs.model.Publication)6 Test (org.junit.Test)6 Parameters (junitparams.Parameters)4 JsonArray (io.vertx.core.json.JsonArray)1 JsonObject (io.vertx.core.json.JsonObject)1 UUID (java.util.UUID)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 Instance (org.folio.rest.jaxrs.model.Instance)1 InstancesBatchResponse (org.folio.rest.jaxrs.model.InstancesBatchResponse)1 NatureOfContentTerm (org.folio.rest.jaxrs.model.NatureOfContentTerm)1 IndividualResource (org.folio.rest.support.IndividualResource)1 JsonErrorResponse (org.folio.rest.support.JsonErrorResponse)1 Response (org.folio.rest.support.Response)1 DomainEventAssertions.assertCreateEventForInstance (org.folio.rest.support.matchers.DomainEventAssertions.assertCreateEventForInstance)1 DomainEventAssertions.assertRemoveAllEventForInstance (org.folio.rest.support.matchers.DomainEventAssertions.assertRemoveAllEventForInstance)1 DomainEventAssertions.assertRemoveEventForInstance (org.folio.rest.support.matchers.DomainEventAssertions.assertRemoveEventForInstance)1 DomainEventAssertions.assertUpdateEventForInstance (org.folio.rest.support.matchers.DomainEventAssertions.assertUpdateEventForInstance)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1