-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dockstore/dockstore#5745 DOCK-2493
- Loading branch information
Charles Overbeck
committed
Aug 21, 2024
1 parent
942caaf
commit de267b7
Showing
3 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,39 @@ | ||
package io.dockstore; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import io.swagger.zenodo.client.ApiClient; | ||
import io.swagger.zenodo.client.model.SearchResult; | ||
import java.net.URLEncoder; | ||
import java.nio.charset.StandardCharsets; | ||
import java.util.HashMap; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ZenodoClientTest { | ||
|
||
private static ApiClient client; | ||
private static io.swagger.zenodo.client.api.PreviewApi previewApi; | ||
|
||
public class ZenodoClientTest { | ||
@BeforeAll | ||
static void setup() { | ||
client = new ApiClient(); | ||
client.setBasePath("https://sandbox.zenodo.org/api"); | ||
previewApi = new io.swagger.zenodo.client.api.PreviewApi(client); | ||
} | ||
|
||
@org.junit.jupiter.api.Test | ||
@Test | ||
@Disabled("Test disabled as the communities API is failing on sandbox") | ||
public void testZenodoClient() throws io.swagger.zenodo.client.ApiException { | ||
io.swagger.zenodo.client.ApiClient client = new io.swagger.zenodo.client.ApiClient(); | ||
client.setBasePath("https://sandbox.zenodo.org/api"); | ||
io.swagger.zenodo.client.api.PreviewApi previewApi = new io.swagger.zenodo.client.api.PreviewApi(client); | ||
HashMap<String, Object> o = (HashMap<String, Object>)previewApi.listCommunities(); | ||
assertTrue(o != null && !o.keySet().isEmpty(), "not able to list communities as basic test"); | ||
} | ||
|
||
@Test | ||
void testConceptDoi() { | ||
final SearchResult searchResult = previewApi.listRecords(null, "bestmatch", 1, 100); | ||
assertNotNull(searchResult.getHits().getHits().get(0).getConceptdoi()); | ||
} | ||
} |