From 6af53defd9879bb02758a57bba2e4306ac9506e2 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Fri, 6 Dec 2019 15:34:21 +0100 Subject: [PATCH] fix springer fetcher tests --- .../org/jabref/logic/importer/fetcher/SpringerFetcher.java | 2 +- .../jabref/logic/importer/fetcher/SpringerFetcherTest.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java index 8d9221709a0..0e914c881b0 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java @@ -38,7 +38,7 @@ public class SpringerFetcher implements SearchBasedParserFetcher { private static final Logger LOGGER = LoggerFactory.getLogger(SpringerFetcher.class); private static final String API_URL = "http://api.springernature.com/meta/v1/json?q="; - private static final String API_KEY = "b0c7151179b3d9c1119cf325bca8460d"; + private static final String API_KEY = "a98b4a55181ffcd27259bea45edad12e"; /** * Convert a JSONObject obtained from http://api.springer.com/metadata/json to a BibEntry diff --git a/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java index cb4d188e5e0..ee1d3a76c4d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java @@ -7,6 +7,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; +import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; import kong.unirest.json.JSONObject; @@ -25,6 +26,7 @@ void setUp() { fetcher = new SpringerFetcher(); } + @DisabledOnCIServer("Disable on CI Server to not hit the API call limit") @Test void searchByQueryFindsEntry() throws Exception { BibEntry expected = new BibEntry(StandardEntryType.Article); @@ -47,6 +49,7 @@ void searchByQueryFindsEntry() throws Exception { assertEquals(Collections.singletonList(expected), fetchedEntries); } + @DisabledOnCIServer("Disable on CI Server to not hit the API call limit") @Test void testSpringerJSONToBibtex() { String jsonString = "{\r\n" + " \"identifier\":\"doi:10.1007/BF01201962\",\r\n" @@ -70,6 +73,7 @@ void testSpringerJSONToBibtex() { assertEquals(Optional.of("1992-09-01"), bibEntry.getField(StandardField.DATE)); } + @DisabledOnCIServer("Disable on CI Server to not hit the API call limit") @Test void searchByEmptyQueryFindsNothing() throws Exception { assertEquals(Collections.emptyList(), fetcher.performSearch(""));