use of org.folio.rest.jaxrs.model.PackagePutDataAttributes in project mod-kb-ebsco-java by folio-org.
the class PackageRequestConverter method convertToRMAPICustomPackagePutRequest.
public PackagePut convertToRMAPICustomPackagePutRequest(PackagePutRequest request) {
PackagePutDataAttributes attributes = request.getData().getAttributes();
PackagePut.PackagePutBuilder builder = convertCommonAttributesToPackagePutRequest(attributes);
builder.packageName(attributes.getName());
Integer contentType = contentTypeToRMAPICode.get(attributes.getContentType());
builder.contentType(contentType != null ? contentType : 6);
return builder.build();
}
use of org.folio.rest.jaxrs.model.PackagePutDataAttributes in project mod-kb-ebsco-java by folio-org.
the class PackageRequestConverterTest method shouldCreateRequestToChangeCustomPackageCoverageDatesToEmpty.
@Test
public void shouldCreateRequestToChangeCustomPackageCoverageDatesToEmpty() {
PackagePut packagePut = packagesConverter.convertToRMAPICustomPackagePutRequest(PackagesTestData.getPackagePutRequest(new PackagePutDataAttributes().withCustomCoverage(new Coverage().withBeginCoverage("").withEndCoverage(""))));
assertEquals("", packagePut.getCustomCoverage().getBeginCoverage());
assertEquals("", packagePut.getCustomCoverage().getEndCoverage());
}
use of org.folio.rest.jaxrs.model.PackagePutDataAttributes in project mod-kb-ebsco-java by folio-org.
the class PackageRequestConverterTest method shouldCreateRequestToChangeCustomPackageCoverageDates.
@Test
public void shouldCreateRequestToChangeCustomPackageCoverageDates() {
PackagePut packagePut = packagesConverter.convertToRMAPICustomPackagePutRequest(PackagesTestData.getPackagePutRequest(new PackagePutDataAttributes().withCustomCoverage(new Coverage().withBeginCoverage("2003-01-01").withEndCoverage("2004-01-01"))));
assertEquals("2003-01-01", packagePut.getCustomCoverage().getBeginCoverage());
assertEquals("2004-01-01", packagePut.getCustomCoverage().getEndCoverage());
}
use of org.folio.rest.jaxrs.model.PackagePutDataAttributes in project mod-kb-ebsco-java by folio-org.
the class PackageRequestConverterTest method shouldCreateRequestToAddCustomCoverage.
@Test
public void shouldCreateRequestToAddCustomCoverage() {
PackagePut packagePut = packagesConverter.convertToRMAPIPackagePutRequest(PackagesTestData.getPackagePutRequest(new PackagePutDataAttributes().withIsSelected(true).withCustomCoverage(new Coverage().withBeginCoverage("2000-10-10").withEndCoverage("2000-11-10"))));
assertEquals("2000-10-10", packagePut.getCustomCoverage().getBeginCoverage());
assertEquals("2000-11-10", packagePut.getCustomCoverage().getEndCoverage());
}
use of org.folio.rest.jaxrs.model.PackagePutDataAttributes in project mod-kb-ebsco-java by folio-org.
the class PackageRequestConverterTest method shouldCreateRequestToChangeCustomPackageContentType.
@Test
public void shouldCreateRequestToChangeCustomPackageContentType() {
PackagePut packagePut = packagesConverter.convertToRMAPICustomPackagePutRequest(PackagesTestData.getPackagePutRequest(new PackagePutDataAttributes().withContentType(ContentType.STREAMING_MEDIA)));
Integer aggregatedFullTextContentTypeCode = 8;
assertEquals(aggregatedFullTextContentTypeCode, packagePut.getContentType());
}
Aggregations