use of org.openarchives.oai._2.VerbType in project mod-oai-pmh by folio-org.
the class OaiPmhImplTest method headersDatestampsShouldCorrespondToDateOnlyGranularitySetting.
@ParameterizedTest
@MethodSource("allMetadataPrefixesAndListVerbsProvider")
void headersDatestampsShouldCorrespondToDateOnlyGranularitySetting(MetadataPrefix prefix, VerbType verb) {
String timeGranularity = System.getProperty(REPOSITORY_TIME_GRANULARITY);
System.setProperty(REPOSITORY_TIME_GRANULARITY, GranularityType.YYYY_MM_DD_THH_MM_SS_Z.value());
RequestSpecification request = createBaseRequest().with().param(VERB_PARAM, verb.value()).param(FROM_PARAM, THREE_INSTANCES_DATE).param(METADATA_PREFIX_PARAM, prefix.getName());
OAIPMH oaipmh = verify200WithXml(request, verb);
verifyHeaderDateStamp(oaipmh, verb, GranularityType.YYYY_MM_DD_THH_MM_SS_Z.value());
System.setProperty(REPOSITORY_TIME_GRANULARITY, timeGranularity);
}
use of org.openarchives.oai._2.VerbType in project mod-oai-pmh by folio-org.
the class OaiPmhImplTest method checkSupportDeletedRecordsWhenDeletedConfigIsNoAndSuppressedConfigFalse.
@ParameterizedTest
@MethodSource("metadataPrefixAndVerbProviderExceptMarc21withHoldings")
void checkSupportDeletedRecordsWhenDeletedConfigIsNoAndSuppressedConfigFalse(MetadataPrefix prefix, VerbType verb) {
String repositorySuppressDiscovery = System.getProperty(REPOSITORY_SUPPRESSED_RECORDS_PROCESSING);
String repositoryDeletedRecords = System.getProperty(REPOSITORY_DELETED_RECORDS);
System.setProperty(REPOSITORY_DELETED_RECORDS, "no");
System.setProperty(REPOSITORY_SUPPRESSED_RECORDS_PROCESSING, "false");
RequestSpecification request = createBaseRequest().with().param(VERB_PARAM, verb.value()).param(FROM_PARAM, THREE_INSTANCES_DATE).param(METADATA_PREFIX_PARAM, prefix.getName());
OAIPMH oaipmh = verify200WithXml(request, verb);
verifyListResponse(oaipmh, verb, 3);
System.setProperty(REPOSITORY_SUPPRESSED_RECORDS_PROCESSING, repositorySuppressDiscovery);
System.setProperty(REPOSITORY_DELETED_RECORDS, repositoryDeletedRecords);
}
use of org.openarchives.oai._2.VerbType in project mod-oai-pmh by folio-org.
the class OaiPmhImplTest method getOaiListVerbWithoutParams.
@ParameterizedTest
@EnumSource(value = VerbType.class, names = { "LIST_IDENTIFIERS", "LIST_RECORDS" })
void getOaiListVerbWithoutParams(VerbType verb) {
RequestSpecification request = createBaseRequest().with().param(VERB_PARAM, verb.value());
List<OAIPMHerrorType> errors = verifyResponseWithErrors(request, verb, 400, 1).getErrors();
OAIPMHerrorType error = errors.get(0);
assertThat(error.getCode(), equalTo(BAD_ARGUMENT));
assertThat(error.getValue(), equalTo(LIST_NO_REQUIRED_PARAM_ERROR));
}
use of org.openarchives.oai._2.VerbType in project mod-oai-pmh by folio-org.
the class OaiPmhImplTest method checkSupportDeletedRecordsWhenDeletedConfigIsNoAndSuppressedConfigTrueAndRecordMarkedAsDeleted.
@ParameterizedTest
@MethodSource("metadataPrefixAndVerbProviderExceptMarc21withHoldings")
void checkSupportDeletedRecordsWhenDeletedConfigIsNoAndSuppressedConfigTrueAndRecordMarkedAsDeleted(MetadataPrefix prefix, VerbType verb) {
String repositorySuppressDiscovery = System.getProperty(REPOSITORY_SUPPRESSED_RECORDS_PROCESSING);
String repositoryDeletedRecords = System.getProperty(REPOSITORY_DELETED_RECORDS);
System.setProperty(REPOSITORY_DELETED_RECORDS, "no");
System.setProperty(REPOSITORY_SUPPRESSED_RECORDS_PROCESSING, "true");
RequestSpecification request = createBaseRequest().with().param(VERB_PARAM, verb.value()).param(FROM_PARAM, THREE_INSTANCES_DATE_WITH_ONE_MARK_DELETED_RECORD).param(METADATA_PREFIX_PARAM, prefix.getName());
OAIPMH oaipmh = verify200WithXml(request, verb);
verifyListResponse(oaipmh, verb, 2);
System.setProperty(REPOSITORY_SUPPRESSED_RECORDS_PROCESSING, repositorySuppressDiscovery);
System.setProperty(REPOSITORY_DELETED_RECORDS, repositoryDeletedRecords);
}
use of org.openarchives.oai._2.VerbType in project mod-oai-pmh by folio-org.
the class OaiPmhImplTest method checkSupportDeletedRecordsWhenDeletedConfigPersistentAndSuppressedConfigFalseAndSuppressInRecordTrue.
@ParameterizedTest
@MethodSource("metadataPrefixAndVerbProviderExceptMarc21withHoldings")
void checkSupportDeletedRecordsWhenDeletedConfigPersistentAndSuppressedConfigFalseAndSuppressInRecordTrue(MetadataPrefix prefix, VerbType verb) {
String repositorySuppressDiscovery = System.getProperty(REPOSITORY_SUPPRESSED_RECORDS_PROCESSING);
String repositoryDeletedRecords = System.getProperty(REPOSITORY_DELETED_RECORDS);
System.setProperty(REPOSITORY_DELETED_RECORDS, "persistent");
System.setProperty(REPOSITORY_SUPPRESSED_RECORDS_PROCESSING, "false");
RequestSpecification request = createBaseRequest().with().param(VERB_PARAM, verb.value()).param(FROM_PARAM, NO_RECORDS_DATE).param(METADATA_PREFIX_PARAM, prefix.getName());
OAIPMH oaipmh = verifyResponseWithErrors(request, verb, 404, 1);
assertThat(oaipmh.getErrors().get(0).getCode(), equalTo(NO_RECORDS_MATCH));
System.setProperty(REPOSITORY_SUPPRESSED_RECORDS_PROCESSING, repositorySuppressDiscovery);
System.setProperty(REPOSITORY_DELETED_RECORDS, repositoryDeletedRecords);
}
Aggregations