use of org.folio.repository.packages.DbPackage in project mod-kb-ebsco-java by folio-org.
the class EholdingsPackagesTest method shouldDeletePackageOnDeleteRequest.
@Test
public void shouldDeletePackageOnDeleteRequest() throws IOException, URISyntaxException {
sendPost(readFile("requests/kb-ebsco/package/post-package-request.json"));
sendPutTags(Collections.singletonList(STUB_TAG_VALUE));
mockGet(new EqualToPattern(PACKAGE_BY_ID_URL), CUSTOM_PACKAGE_STUB_FILE);
mockPut(new EqualToPattern(PACKAGE_BY_ID_URL), new AnythingPattern(), SC_NO_CONTENT);
deleteWithNoContent(PACKAGES_PATH, STUB_TOKEN_HEADER);
List<DbPackage> packages = PackagesTestUtil.getPackages(vertx);
assertThat(packages, is(empty()));
}
use of org.folio.repository.packages.DbPackage in project mod-kb-ebsco-java by folio-org.
the class PackageCollectionResultConverter method convert.
@Override
public PackageCollection convert(@NonNull PackageCollectionResult packagesResult) {
Packages packages = packagesResult.getPackages();
List<DbPackage> dbPackages = packagesResult.getDbPackages();
List<PackageCollectionItem> packageList = mapItems(packages.getPackagesList(), packageData -> {
PackageCollectionItem item = packageCollectionItemConverter.convert(packageData);
item.getAttributes().withTags(new Tags().withTagList(getTagsById(dbPackages, createPackageId(packageData))));
return item;
});
return new PackageCollection().withJsonapi(RestConstants.JSONAPI).withMeta(new MetaTotalResults().withTotalResults(packages.getTotalResults())).withData(packageList);
}
Aggregations