From 8eb70e6657870e0d661a5c8619076bc013eb23ee Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Mon, 27 Nov 2023 15:13:15 +0100 Subject: [PATCH] refactoring --- .../PrepareAffiliationRelationsTest.java | 4 ++-- .../eu/dnetlib/dhp/api/QueryCommunityAPI.java | 21 ++++++++----------- .../PrepareResultCommunitySet.java | 2 +- .../dnetlib/dhp/bulktag/BulkTagJobTest.java | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/bipaffiliations/PrepareAffiliationRelationsTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/bipaffiliations/PrepareAffiliationRelationsTest.java index e2639996c..b87738879 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/bipaffiliations/PrepareAffiliationRelationsTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/bipaffiliations/PrepareAffiliationRelationsTest.java @@ -79,8 +79,8 @@ public class PrepareAffiliationRelationsTest { .getPath(); String pubmedAffiliationRelationsPath = getClass() - .getResource("/eu/dnetlib/dhp/actionmanager/bipaffiliations/doi_to_ror.json") - .getPath(); + .getResource("/eu/dnetlib/dhp/actionmanager/bipaffiliations/doi_to_ror.json") + .getPath(); String outputPath = workingDir.toString() + "/actionSet"; diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/api/QueryCommunityAPI.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/api/QueryCommunityAPI.java index b7c0164c1..cf33c6509 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/api/QueryCommunityAPI.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/api/QueryCommunityAPI.java @@ -15,8 +15,6 @@ import org.jetbrains.annotations.NotNull; */ public class QueryCommunityAPI { - - private static String get(String geturl) throws IOException { URL url = new URL(geturl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); @@ -34,32 +32,31 @@ public class QueryCommunityAPI { public static String communities(String baseURL) throws IOException { - return get(baseURL + "communities"); + return get(baseURL + "communities"); } - public static String community(String id, String baseURL ) throws IOException { + public static String community(String id, String baseURL) throws IOException { - return get(baseURL + id); + return get(baseURL + id); } - public static String communityDatasource(String id, String baseURL ) throws IOException { - - return get(baseURL + id + "/contentproviders"); + public static String communityDatasource(String id, String baseURL) throws IOException { + return get(baseURL + id + "/contentproviders"); } - public static String communityPropagationOrganization(String id, String baseURL ) throws IOException { + public static String communityPropagationOrganization(String id, String baseURL) throws IOException { - return get(baseURL + id + "/propagationOrganizations"); + return get(baseURL + id + "/propagationOrganizations"); } - public static String communityProjects(String id, String page, String size, String baseURL ) throws IOException { + public static String communityProjects(String id, String page, String size, String baseURL) throws IOException { - return get(baseURL + id + "/projects/" + page + "/" + size); + return get(baseURL + id + "/projects/" + page + "/" + size); } diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/resulttocommunityfromproject/PrepareResultCommunitySet.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/resulttocommunityfromproject/PrepareResultCommunitySet.java index 2c2eb69dd..7fed2606b 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/resulttocommunityfromproject/PrepareResultCommunitySet.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/resulttocommunityfromproject/PrepareResultCommunitySet.java @@ -52,7 +52,7 @@ public class PrepareResultCommunitySet { final String outputPath = parser.get("outputPath"); log.info("outputPath: {}", outputPath); - final String baseURL = parser.get("baseURL"); + final String baseURL = parser.get("baseURL"); log.info("baseUEL: {}", baseURL); final CommunityEntityMap projectsMap = Utils.getCommunityProjects(baseURL); diff --git a/dhp-workflows/dhp-enrichment/src/test/java/eu/dnetlib/dhp/bulktag/BulkTagJobTest.java b/dhp-workflows/dhp-enrichment/src/test/java/eu/dnetlib/dhp/bulktag/BulkTagJobTest.java index d193716a8..743e62b5f 100644 --- a/dhp-workflows/dhp-enrichment/src/test/java/eu/dnetlib/dhp/bulktag/BulkTagJobTest.java +++ b/dhp-workflows/dhp-enrichment/src/test/java/eu/dnetlib/dhp/bulktag/BulkTagJobTest.java @@ -1576,7 +1576,7 @@ public class BulkTagJobTest { "-outputPath", workingDir.toString() + "/", // "-baseURL", "https://services.openaire.eu/openaire/community/", "-pathMap", pathMap, - "-taggingConf", taggingConf + "-taggingConf", taggingConf }); final JavaSparkContext sc = JavaSparkContext.fromSparkContext(spark.sparkContext());