Skip to content

Commit

Permalink
Add the concept DOI to SearchResult
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Overbeck committed Aug 21, 2024
1 parent 942caaf commit de267b7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 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
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
30 changes: 25 additions & 5 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.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());
}
}

0 comments on commit de267b7

Please sign in to comment.