diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java index 4432df75bcd..2eb837d2364 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java @@ -203,15 +203,13 @@ private static Stream allNonWithdrawnIdsWithOldHtmlFormat() { @Test public void getFulltextWithVersion() throws FetcherException, IOException { Optional pdfUrl = fetcher.findFullText(abram2017); - assertTrue(pdfUrl.isPresent()); - assertEquals("https://eprint.iacr.org/archive/2017/1118/1511505927.pdf", pdfUrl.get().toString()); + assertEquals(Optional.of("https://eprint.iacr.org/archive/2017/1118/1511505927.pdf"), pdfUrl.map(URL::toString)); } @Test public void getFulltextWithoutVersion() throws FetcherException, IOException { Optional pdfUrl = fetcher.findFullText(abram2017noVersion); - assertTrue(pdfUrl.isPresent()); - assertEquals("https://eprint.iacr.org/2017/1118.pdf", pdfUrl.get().toString()); + assertEquals(Optional.of("https://eprint.iacr.org/2017/1118.pdf"), pdfUrl.map(URL::toString)); } @Test @@ -219,11 +217,11 @@ public void getFulltextWithoutUrl() throws FetcherException, IOException { BibEntry abram2017WithoutUrl = abram2017; abram2017WithoutUrl.clearField(StandardField.URL); Optional pdfUrl = fetcher.findFullText(abram2017WithoutUrl); - assertTrue(pdfUrl.isEmpty()); + assertEquals(Optional.empty(), pdfUrl); } @Test - public void getFulltextWithNonIACRUrl() throws FetcherException, IOException { + public void getFulltextWithNonIACRUrl() throws IOException { BibEntry abram2017WithNonIACRUrl = abram2017; abram2017WithNonIACRUrl.setField(StandardField.URL, "https://example.com"); assertThrows(FetcherException.class, () -> fetcher.findFullText(abram2017WithNonIACRUrl));