Skip to content

Commit

Permalink
Merge pull request #67 from sanctuuary/fix_tests
Browse files Browse the repository at this point in the history
Fix the javadocs and imports
  • Loading branch information
vedran-kasalica authored Jul 30, 2024
2 parents 7f85e3f + a66f041 commit b7b4781
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import okhttp3.Response;

/**
* The {@code BiotoolsAPI} class provides methods to retrieve and process tool metrics
* The {@code BioToolsRestClient} class provides methods to retrieve and process tool metrics
* provided by bio.tools API.
*/
@Slf4j
Expand All @@ -34,22 +34,24 @@ public class BioToolsRestClient {
* @throws JSONException In case the JSON object returned by bio.tools cannot be
* parsed.
*/
public static JSONObject fetchToolFromBioTools(String toolID) throws JSONException, IOException {
JSONObject bioToolAnnotation;
toolID = toolID.toLowerCase();
String urlToBioTools = "https://bio.tools/api/" + toolID +
"?format=json";
Request request = new Request.Builder().url(urlToBioTools).build();
Response response = client.newCall(request).execute();

if (!response.isSuccessful()) {
throw new IOException("Tool " + toolID + " not found in bio.tools.");
}

bioToolAnnotation = new JSONObject(response.body().string());
response.close();

log.debug("The list of tools successfully fetched from bio.tools.");
return bioToolAnnotation;
}
public static JSONObject fetchToolFromBioTools(String toolID) throws JSONException, IOException {
JSONObject bioToolAnnotation;
toolID = toolID.toLowerCase();
String urlToBioTools = "https://bio.tools/api/" + toolID +
"?format=json";
Request request = new Request.Builder().url(urlToBioTools).build();
Response response = client.newCall(request).execute();

if (!response.isSuccessful()) {
throw new IOException("Tool " + toolID + " not found in bio.tools.");
}

bioToolAnnotation = new JSONObject(response.body().string());
response.close();

log.debug("The list of tools successfully fetched from bio.tools.");
return bioToolAnnotation;
}


}
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package nl.esciencecenter.models.benchmarks;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.json.JSONObject;

import com.oracle.truffle.regex.tregex.util.json.JsonObject;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import nl.esciencecenter.restape.ToolBenchmarkingAPIs;

@Data
@NoArgsConstructor
Expand Down

0 comments on commit b7b4781

Please sign in to comment.