Skip to content

Commit 20dbba5

Browse files
IvanPetkov23i10320
and
i10320
authored
Add default api key support for springer fetcher tests (#12636)
Co-authored-by: i10320 <[email protected]>
1 parent 7e5bdc0 commit 20dbba5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
import org.jabref.logic.importer.ImporterPreferences;
1010
import org.jabref.logic.importer.PagedSearchBasedFetcher;
1111
import org.jabref.logic.importer.SearchBasedFetcher;
12+
import org.jabref.logic.util.BuildInfo;
1213
import org.jabref.model.entry.BibEntry;
1314
import org.jabref.model.entry.field.StandardField;
1415
import org.jabref.model.entry.types.StandardEntryType;
1516
import org.jabref.testutils.category.FetcherTest;
1617

18+
import com.airhacks.afterburner.injection.Injector;
1719
import kong.unirest.core.json.JSONObject;
1820
import org.junit.jupiter.api.BeforeEach;
1921
import org.junit.jupiter.api.Disabled;
@@ -32,8 +34,10 @@ class SpringerFetcherTest implements SearchBasedFetcherCapabilityTest, PagedSear
3234

3335
@BeforeEach
3436
void setUp() {
35-
when(importerPreferences.getApiKeys()).thenReturn(FXCollections.emptyObservableSet());
37+
BuildInfo buildInfo = Injector.instantiateModelOrService(BuildInfo.class);
3638
fetcher = new SpringerFetcher(importerPreferences);
39+
when(importerPreferences.getApiKeys()).thenReturn(FXCollections.emptyObservableSet());
40+
when(importerPreferences.getApiKey(fetcher.getName())).thenReturn(Optional.of(buildInfo.springerNatureAPIKey));
3741
}
3842

3943
@Test

0 commit comments

Comments
 (0)