package net.sf.jabref.external;

import net.sf.jabref.logic.fetcher.FullTextFinder;
import net.sf.jabref.model.entry.BibEntry;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.net.URL;
import java.util.Arrays;
import java.util.Optional;

import static org.junit.Assert.*;

public class FindFullTextTest {
    private BibEntry entry;

    @Before
    public void setup() {
        entry = new BibEntry();
    }

    @After
    public void teardown() {
        entry = null;
    }

    @Test
    public void acceptPdfUrls() throws Exception {
        URL pdfUrl = new URL("https://www.uni-bamberg.de/fileadmin/uni/fakultaeten/wiai_lehrstuehle/praktische_informatik/Dateien/Publikationen/cloud15-application-migration-effort-in-the-cloud.pdf");
        FullTextFinder finder = (e) -> Optional.of(pdfUrl);
        FindFullText fetcher = new FindFullText(Arrays.asList(finder));

        assertEquals(Optional.of(pdfUrl), fetcher.findFullTextPDF(entry));
    }
}
@@ -985,9 +985,374 @@
 ;%0A    %7D%0A
-%7D
+%0A    @Test%0A    public void rejectNonPdfUrls() throws Exception %7B%0A        URL pdfUrl = new URL(%22https://github.com/JabRef/jabref/blob/master/README.md%22);%0A        FullTextFinder finder = (e) -%3E Optional.of(pdfUrl);%0A        FindFullText fetcher = new FindFullText(Arrays.asList(finder));%0A%0A        assertEquals(Optional.empty(), fetcher.findFullTextPDF(entry));%0A    %7D%0A%7D%0A

Add opposite test