diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java index e3180d06c7d..4781ab4fb86 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java @@ -20,6 +20,7 @@ import static org.jabref.logic.importer.fetcher.transformers.AbstractQueryTransformer.NO_EXPLICIT_FIELD; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; @FetcherTest class ACMPortalFetcherTest { @@ -33,8 +34,7 @@ void setUp() { @Test void searchByQueryFindsEntry() throws Exception { - List searchEntryList = List.of( - new BibEntry(StandardEntryType.Conference) + BibEntry searchEntry = new BibEntry(StandardEntryType.Conference) .withField(StandardField.AUTHOR, "Tobias Olsson and Morgan Ericsson and Anna Wingkvist") .withField(StandardField.YEAR, "2017") .withField(StandardField.MONTH, "9") @@ -50,16 +50,15 @@ void searchByQueryFindsEntry() throws Exception { .withField(StandardField.TITLE, "The relationship of code churn and architectural violations in the open source software JabRef") .withField(StandardField.URL, "https://doi.org/10.1145/3129790.3129810") .withField(StandardField.PAGETOTAL, "7") - .withField(StandardField.PAGES, "152–158") - ); + .withField(StandardField.PAGES, "152–158"); List fetchedEntries = fetcher.performSearch("The relationship of code churn and architectural violations in the open source software JabRef"); // we clear the abstract due to copyright reasons (JabRef's code should not contain copyrighted abstracts) for (BibEntry bibEntry : fetchedEntries) { bibEntry.clearField(StandardField.ABSTRACT); } - // check for a) that a single entry is returned and b) that the entry itself is the expected one - assertEquals(searchEntryList, fetchedEntries); + assertFalse(fetchedEntries.isEmpty()); + assertEquals(searchEntry, fetchedEntries.get(0)); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java b/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java index 66bb5759249..d37fa902d54 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java @@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; @FetcherTest public class ACMPortalParserTest { @@ -77,10 +78,11 @@ void testParseEntries() throws IOException, ParseException { @Test void testParseDoiSearchPage() throws ParseException, IOException { - List testDoiList = List.of("10.1145/3129790.3129810"); + String testDoi = "10.1145/3129790.3129810"; CookieHandler.setDefault(new CookieManager()); List doiList = parser.parseDoiSearchPage(new URLDownload(searchUrl).asInputStream()); - assertEquals(testDoiList, doiList); + assertFalse(doiList.isEmpty()); + assertEquals(testDoi, doiList.get(0)); } @Test