use of org.folio.rest.jaxrs.model.VisibilityData in project mod-kb-ebsco-java by folio-org.
the class ResourceRequestConverterTest method shouldCreateRequestToUpdateIsHiddenForManagedResource.
@Test
public void shouldCreateRequestToUpdateIsHiddenForManagedResource() {
ResourcePut resourcePut = resourcesConverter.convertToRMAPIResourcePutRequest(ResourcesTestData.getResourcePutRequest(new ResourcePutDataAttributes().withIsSelected(true).withVisibilityData(new VisibilityData().withIsHidden(false))), resourceData);
assertFalse(resourcePut.getIsHidden());
}
use of org.folio.rest.jaxrs.model.VisibilityData in project mod-kb-ebsco-java by folio-org.
the class PackageCollectionItemConverter method convert.
@Override
public PackageCollectionItem convert(@NonNull PackageData packageData) {
Integer providerId = packageData.getVendorId();
String providerName = packageData.getVendorName();
Integer packageId = packageData.getPackageId();
return new PackageCollectionItem().withId(providerId + "-" + packageId).withType(PACKAGES_TYPE).withAttributes(new PackageDataAttributes().withContentType(contentTypes.get(packageData.getContentType().toLowerCase())).withCustomCoverage(new Coverage().withBeginCoverage(packageData.getCustomCoverage().getBeginCoverage()).withEndCoverage(packageData.getCustomCoverage().getEndCoverage())).withIsCustom(packageData.getIsCustom()).withIsSelected(packageData.getIsSelected()).withName(packageData.getPackageName()).withPackageId(packageId).withPackageType(packageData.getPackageType()).withProviderId(providerId).withProviderName(providerName).withSelectedCount(packageData.getSelectedCount()).withTitleCount(packageData.getTitleCount()).withAllowKbToAddTitles(packageData.getAllowEbscoToAddTitles()).withVisibilityData(new VisibilityData().withIsHidden(packageData.getVisibilityData().getIsHidden()).withReason(packageData.getVisibilityData().getReason().equals("Hidden by EP") ? "Set by system" : ""))).withRelationships(createEmptyPackageRelationship());
}
use of org.folio.rest.jaxrs.model.VisibilityData in project mod-kb-ebsco-java by folio-org.
the class VisibilityInfoConverter method convert.
@Override
public VisibilityData convert(@Nullable VisibilityInfo visibilityData) {
if (Objects.isNull(visibilityData)) {
return null;
}
org.folio.rest.jaxrs.model.VisibilityData visibility = new org.folio.rest.jaxrs.model.VisibilityData();
visibility.setIsHidden(visibilityData.getIsHidden());
visibility.setReason(visibilityData.getReason().equals("Hidden by EP") ? "Set by system" : "");
return visibility;
}
use of org.folio.rest.jaxrs.model.VisibilityData in project mod-kb-ebsco-java by folio-org.
the class PackageRequestConverterTest method shouldCreateRequestToChangeCustomPackageVisibility.
@Test
public void shouldCreateRequestToChangeCustomPackageVisibility() {
PackagePut packagePut = packagesConverter.convertToRMAPICustomPackagePutRequest(PackagesTestData.getPackagePutRequest(new PackagePutDataAttributes().withVisibilityData(new VisibilityData().withIsHidden(true))));
assertTrue(packagePut.getIsHidden());
}
use of org.folio.rest.jaxrs.model.VisibilityData in project mod-kb-ebsco-java by folio-org.
the class PackageRequestConverterTest method shouldCreateRequestToHidePackage.
@Test
public void shouldCreateRequestToHidePackage() {
PackagePut packagePut = packagesConverter.convertToRMAPIPackagePutRequest(PackagesTestData.getPackagePutRequest(new PackagePutDataAttributes().withIsSelected(true).withVisibilityData(new VisibilityData().withIsHidden(true))));
assertTrue(packagePut.getIsHidden());
}
Aggregations