Skip to content

Commit

Permalink
Merge pull request #24 from dockstore/feature/5745/detection
Browse files Browse the repository at this point in the history
Add the concept DOI to SearchResult
  • Loading branch information
coverbeck authored Aug 23, 2024
2 parents 942caaf + bc348e3 commit d553e25
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
2 changes: 1 addition & 1 deletion generated/src/main/resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.dockstore</groupId>
<artifactId>swagger-java-zenodo-client</artifactId>
<version>2.0.5-SNAPSHOT</version>
<version>2.1.3-SNAPSHOT</version>
<licenses>
<license>
<name>Apache Software License, Version 2.0</name>
Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/zenodo-1.0.0-swagger-2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,8 @@ definitions:
type: string
doi_url:
type: string
conceptdoi:
type: string
metadata:
type: object
properties:
Expand Down
32 changes: 26 additions & 6 deletions src/test/java/io/dockstore/ZenodoClientTest.java
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());
}
}

0 comments on commit d553e25

Please sign in to comment.