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));
}
Aggregations