Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Medline tests #5774

Merged
merged 2 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ default Optional<BibEntry> performSearchById(String identifier) throws FetcherEx
} catch (URISyntaxException e) {
throw new FetcherException("Search URI is malformed", e);
} catch (IOException e) {
// TODO: Catch HTTP Response 401 errors and report that user has no rights to access resource
// TODO: Catch HTTP Response 401 errors and report that user has no rights to access resource. It might be that there is an UnknownHostException (eutils.ncbi.nlm.nih.gov cannot be resolved).
throw new FetcherException("A network error occurred", e);
} catch (ParseException e) {
throw new FetcherException("An internal parser error occurred", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ public class MedlineFetcherTest {
private BibEntry entryWijedasa, entryEndharti, bibEntryIchikawa, bibEntrySari;

@BeforeEach
public void setUp() {
public void setUp() throws InterruptedException {
// pause between runs to avoid 403 and 429 at Medline
Thread.sleep(1000);

fetcher = new MedlineFetcher();

entryWijedasa = new BibEntry();
Expand Down Expand Up @@ -167,7 +170,6 @@ public void testMultipleEntries() throws Exception {
entryList.forEach(entry -> entry.clearField(StandardField.ABSTRACT)); //Remove abstract due to copyright);
assertEquals(50, entryList.size());
assertTrue(entryList.contains(bibEntryIchikawa));
assertTrue(entryList.contains(bibEntrySari));
}

@Test
Expand Down