Search in sources :

Example 1 with VisibilityData

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());
}
Also used : ResourcePutDataAttributes(org.folio.rest.jaxrs.model.ResourcePutDataAttributes) VisibilityData(org.folio.rest.jaxrs.model.VisibilityData) ResourcePut(org.folio.holdingsiq.model.ResourcePut) Test(org.junit.Test)

Example 2 with VisibilityData

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());
}
Also used : PackageCollectionItem(org.folio.rest.jaxrs.model.PackageCollectionItem) PackageDataAttributes(org.folio.rest.jaxrs.model.PackageDataAttributes) Coverage(org.folio.rest.jaxrs.model.Coverage) VisibilityData(org.folio.rest.jaxrs.model.VisibilityData)

Example 3 with VisibilityData

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;
}
Also used : VisibilityData(org.folio.rest.jaxrs.model.VisibilityData) VisibilityData(org.folio.rest.jaxrs.model.VisibilityData)

Example 4 with VisibilityData

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());
}
Also used : PackagePutDataAttributes(org.folio.rest.jaxrs.model.PackagePutDataAttributes) PackagePut(org.folio.holdingsiq.model.PackagePut) VisibilityData(org.folio.rest.jaxrs.model.VisibilityData) Test(org.junit.Test)

Example 5 with VisibilityData

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());
}
Also used : PackagePutDataAttributes(org.folio.rest.jaxrs.model.PackagePutDataAttributes) PackagePut(org.folio.holdingsiq.model.PackagePut) VisibilityData(org.folio.rest.jaxrs.model.VisibilityData) Test(org.junit.Test)

Aggregations

VisibilityData (org.folio.rest.jaxrs.model.VisibilityData)6 Test (org.junit.Test)4 PackagePut (org.folio.holdingsiq.model.PackagePut)2 ResourcePut (org.folio.holdingsiq.model.ResourcePut)2 PackagePutDataAttributes (org.folio.rest.jaxrs.model.PackagePutDataAttributes)2 ResourcePutDataAttributes (org.folio.rest.jaxrs.model.ResourcePutDataAttributes)2 Coverage (org.folio.rest.jaxrs.model.Coverage)1 PackageCollectionItem (org.folio.rest.jaxrs.model.PackageCollectionItem)1 PackageDataAttributes (org.folio.rest.jaxrs.model.PackageDataAttributes)1