Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix springer fetcher tests #5715

Merged
merged 1 commit into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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"
Expand All @@ -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(""));
Expand Down