package eu.dzhw.fdz.metadatamanagement.datapackagemanagement.service;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import eu.dzhw.fdz.metadatamanagement.AbstractTest;
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.MetadataExportFormat;

@Disabled("Da-ra OAI-PMH is currently down!")
public class DaraOaiPmhClientTest extends AbstractTest {
  @Autowired
  private DaraOaiPmhClient oaiPmhClient;

  @Test
  public void testSuccessfullMetadataRetrieval() {
    String metadata = oaiPmhClient
        .getMetadata("10.21249/DZHW:gra2005:2.0.1", MetadataExportFormat.oai_dc).getBody();
    String title =
        StringUtils.substringBetween(metadata, "<dc:title xml:lang=\"de\">", "</dc:title>");

    assertEquals("DZHW-Absolventenpanel 2005", title);;
  }
}

@@ -175,47 +175,8 @@
 ls;%0A
-import org.junit.jupiter.api.Disabled;%0A
 impo
@@ -416,54 +416,8 @@
 t;%0A%0A
-@Disabled(%22Da-ra OAI-PMH is currently down!%22)%0A
 publ

Revert "disable oai-pmh client tests to fix the build (#3046)"