-
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.
Merge pull request #24 from dockstore/feature/5745/detection
Add the concept DOI to SearchResult
- Loading branch information
Showing
4 changed files
with
31 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,11 +26,10 @@ | |
<properties> | ||
<github.url>scm:git:[email protected]:dockstore/swagger-java-zenodo-client.git</github.url> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<dockstore-core.version>1.15.0-beta.0</dockstore-core.version> | ||
<dockstore-core.version>1.16.0-alpha.13</dockstore-core.version> | ||
<maven-failsafe.version>2.21.0</maven-failsafe.version> | ||
<maven-surefire.version>2.21.0</maven-surefire.version> | ||
<maven-surefire.version>3.4.0</maven-surefire.version> | ||
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable> | ||
<junit-version>4.12</junit-version> | ||
<jersey-version>3.0.11</jersey-version> | ||
</properties> | ||
|
||
|
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.ApiException; | ||
import io.swagger.zenodo.client.api.PreviewApi; | ||
import io.swagger.zenodo.client.model.SearchResult; | ||
import java.util.HashMap; | ||
|
||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ZenodoClientTest { | ||
|
||
@org.junit.jupiter.api.Test | ||
public void testZenodoClient() throws io.swagger.zenodo.client.ApiException { | ||
io.swagger.zenodo.client.ApiClient client = new io.swagger.zenodo.client.ApiClient(); | ||
private ApiClient client; | ||
private PreviewApi previewApi; | ||
|
||
@BeforeEach | ||
void setup() { | ||
client = new ApiClient(); | ||
client.setBasePath("https://sandbox.zenodo.org/api"); | ||
io.swagger.zenodo.client.api.PreviewApi previewApi = new io.swagger.zenodo.client.api.PreviewApi(client); | ||
previewApi = new io.swagger.zenodo.client.api.PreviewApi(client); | ||
} | ||
|
||
@Test | ||
@Disabled("Test disabled as the communities API is failing on sandbox") | ||
public void testZenodoClient() throws ApiException { | ||
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()); | ||
} | ||
} |