Skip to content

Commit

Permalink
simplified test
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr committed Mar 6, 2023
1 parent 05c8ad3 commit 1336b28
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,27 +203,25 @@ private static Stream<String> allNonWithdrawnIdsWithOldHtmlFormat() {
@Test
public void getFulltextWithVersion() throws FetcherException, IOException {
Optional<URL> 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<URL> 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
public void getFulltextWithoutUrl() throws FetcherException, IOException {
BibEntry abram2017WithoutUrl = abram2017;
abram2017WithoutUrl.clearField(StandardField.URL);
Optional<URL> 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));
Expand Down

0 comments on commit 1336b28

Please sign in to comment.