Search in sources :

Example 6 with DbHoldingInfo

use of org.folio.repository.holdings.DbHoldingInfo in project mod-kb-ebsco-java by folio-org.

the class HoldingsCollectionItemConverterTest method shouldConvertHoldingToResource.

@Test
public void shouldConvertHoldingToResource() throws IOException, URISyntaxException {
    DbHoldingInfo holding = getStubHolding();
    final ResourceCollectionItem resourceCollectionItem = holdingCollectionItemConverter.convert(holding);
    assertThat(resourceCollectionItem.getId(), equalTo("123356-3157070-19412030"));
    assertThat(resourceCollectionItem.getAttributes().getName(), equalTo("Test Title"));
    assertThat(resourceCollectionItem.getAttributes().getTitleId(), equalTo(19412030));
    assertThat(resourceCollectionItem.getAttributes().getPublisherName(), equalTo("Test one Press"));
    assertThat(resourceCollectionItem.getAttributes().getPublicationType(), equalTo(PublicationType.BOOK));
}
Also used : ResourceCollectionItem(org.folio.rest.jaxrs.model.ResourceCollectionItem) DbHoldingInfo(org.folio.repository.holdings.DbHoldingInfo) Test(org.junit.Test)

Aggregations

DbHoldingInfo (org.folio.repository.holdings.DbHoldingInfo)6 Test (org.junit.Test)5 EqualToPattern (com.github.tomakehurst.wiremock.matching.EqualToPattern)2 Async (io.vertx.ext.unit.Async)2 ResourceCollectionItem (org.folio.rest.jaxrs.model.ResourceCollectionItem)2 RegexPattern (com.github.tomakehurst.wiremock.matching.RegexPattern)1 OffsetDateTime (java.time.OffsetDateTime)1 Collections (java.util.Collections)1 Comparator (java.util.Comparator)1 List (java.util.List)1 ListUtils.mapItems (org.folio.common.ListUtils.mapItems)1 HoldingsDownloadTransaction (org.folio.holdingsiq.model.HoldingsDownloadTransaction)1 ResourceId (org.folio.holdingsiq.model.ResourceId)1 Title (org.folio.holdingsiq.model.Title)1 Titles (org.folio.holdingsiq.model.Titles)1 DbResource (org.folio.repository.resources.DbResource)1 HoldingsLoadingStatus (org.folio.rest.jaxrs.model.HoldingsLoadingStatus)1 MetaTotalResults (org.folio.rest.jaxrs.model.MetaTotalResults)1 PackageCostPerUse (org.folio.rest.jaxrs.model.PackageCostPerUse)1 ResourceCollection (org.folio.rest.jaxrs.model.ResourceCollection)1