1515import org .junit .jupiter .api .Test ;
1616
1717import static org .junit .jupiter .api .Assertions .assertEquals ;
18- import static org .junit .jupiter .api .Assertions .assertNotNull ;
1918import static org .mockito .Mockito .mock ;
2019import static org .mockito .Mockito .when ;
2120
@@ -33,10 +32,11 @@ void setUp() {
3332 when (importFormatPreferences .filePreferences ().getUserAndHost ()).thenReturn ("MockedUser-mockedhost" );
3433 }
3534
35+ /// The functionality itself should be tested elsewhere. We keep this test, because we want to have an end-to-end test
3636 @ Test
3737 void provideDefinition () throws JabRefException , IOException {
3838 ParserResult parserResult = lspParserHandler .parserResultFromString (
39- "some-uri" ,
39+ "file:///tmp/ some-uri.bib " ,
4040 """
4141 @Article{Cooper_2007,
4242 author = {Cooper, Karen A. and Donovan, Jennifer L. and Waterhouse, Andrew L. and Williamson, Gary},
@@ -55,7 +55,10 @@ void provideDefinition() throws JabRefException, IOException {
5555 """ ,
5656 importFormatPreferences );
5757 List <LinkedFile > files = parserResult .getDatabaseContext ().getEntries ().getFirst ().getFiles ();
58- assertEquals (2 , files .size ());
59- assertNotNull (files .getLast ().getLink ());
58+ List <LinkedFile > expected = List .of (
59+ new LinkedFile ("" , "C:/Users/Philip/Downloads/corti-et-al-2009-cocoa-and-cardiovascular-health.pdf" , "PDF" ),
60+ new LinkedFile ("" , "corti-et-al-2009-cocoa-and-cardiovascular-health.pdf" , "PDF" )
61+ );
62+ assertEquals (expected , files );
6063 }
6164}
0 commit comments