From 42fb85cd43fa65b1cb59f09e932e7a35cb527b8b Mon Sep 17 00:00:00 2001 From: Christoph Date: Sat, 11 Dec 2021 20:29:58 +0100 Subject: [PATCH] Fix IEEE test (#8320) --- src/main/java/org/jabref/logic/net/URLDownload.java | 3 ++- .../jabref/logic/importer/fetcher/CompositeIdFetcherTest.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jabref/logic/net/URLDownload.java b/src/main/java/org/jabref/logic/net/URLDownload.java index f0c5f778d08..d5d93bd1499 100644 --- a/src/main/java/org/jabref/logic/net/URLDownload.java +++ b/src/main/java/org/jabref/logic/net/URLDownload.java @@ -86,6 +86,7 @@ public URLDownload(String source) throws MalformedURLException { public URLDownload(URL source) { this.source = source; this.addHeader("User-Agent", URLDownload.USER_AGENT); + bypassSSLVerification(); } /** @@ -200,7 +201,7 @@ public boolean canBeReached() throws UnirestException { Unirest.config().setDefaultHeader("User-Agent", "Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); int statusCode = Unirest.head(source.toString()).asString().getStatus(); - return statusCode >= 200 && statusCode < 300; + return (statusCode >= 200) && (statusCode < 300); } public boolean isMimeType(String type) { diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java index c1543e6d2d6..c0a08dd00b8 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java @@ -70,7 +70,7 @@ public static Stream provideTestData() { .withField(StandardField.PUBLISHER, "Addison Wesley") .withField(StandardField.YEAR, "2018") .withField(StandardField.AUTHOR, "Bloch, Joshua") - .withField(StandardField.DATE, "2018-01-01") + .withField(StandardField.DATE, "2018-01-31") .withField(new UnknownField("ean"), "9780134685991") .withField(StandardField.ISBN, "0134685997") .withField(StandardField.URL, "https://www.ebook.de/de/product/28983211/joshua_bloch_effective_java.html") @@ -86,7 +86,7 @@ public static Stream provideTestData() { .withField(StandardField.AUTHOR, "Barry Burd") .withField(StandardField.MONTH, "jul") .withField(StandardField.DOI, "10.1002/9781118257517") - .withCitationKey("2011"), + .withCitationKey("Burd_2011"), "10.1002/9781118257517" ) );