Search in sources :

Example 6 with GET_RECORD

use of org.openarchives.oai._2.VerbType.GET_RECORD in project mod-oai-pmh by folio-org.

the class OaiPmhImplTest method getOaiGetRecordVerbWithExistingIdentifier.

@ParameterizedTest
@EnumSource(MetadataPrefix.class)
void getOaiGetRecordVerbWithExistingIdentifier(MetadataPrefix metadataPrefix) {
    String identifier = IDENTIFIER_PREFIX + OkapiMockServer.EXISTING_IDENTIFIER;
    RequestSpecification request = createBaseRequest().with().param(VERB_PARAM, GET_RECORD.value()).param(IDENTIFIER_PARAM, identifier).param(METADATA_PREFIX_PARAM, metadataPrefix.getName());
    OAIPMH oaiPmhResponseWithExistingIdentifier = verify200WithXml(request, GET_RECORD);
    HeaderType recordHeader = oaiPmhResponseWithExistingIdentifier.getGetRecord().getRecord().getHeader();
    verifyIdentifiers(Collections.singletonList(recordHeader), Collections.singletonList("00000000-0000-4a89-a2f9-78ce3145e4fc"));
    assertThat(oaiPmhResponseWithExistingIdentifier.getGetRecord(), is(notNullValue()));
    assertThat(oaiPmhResponseWithExistingIdentifier.getErrors(), is(empty()));
}
Also used : OAIPMH(org.openarchives.oai._2.OAIPMH) HeaderType(org.openarchives.oai._2.HeaderType) RequestSpecification(io.restassured.specification.RequestSpecification) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Matchers.isEmptyString(org.hamcrest.Matchers.isEmptyString) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

RequestSpecification (io.restassured.specification.RequestSpecification)6 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)6 Matchers.isEmptyString (org.hamcrest.Matchers.isEmptyString)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 OAIPMH (org.openarchives.oai._2.OAIPMH)6 EnumSource (org.junit.jupiter.params.provider.EnumSource)3 Test (org.junit.jupiter.api.Test)2 MethodSource (org.junit.jupiter.params.provider.MethodSource)1 HeaderType (org.openarchives.oai._2.HeaderType)1