Skip to content

Commit e2e3446

Browse files
committed
Fix test
1 parent 07ae63b commit e2e3446

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

jabls/src/test/java/org/jabref/languageserver/util/definition/BibDefinitionProviderTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.junit.jupiter.api.Test;
1616

1717
import static org.junit.jupiter.api.Assertions.assertEquals;
18-
import static org.junit.jupiter.api.Assertions.assertNotNull;
1918
import static org.mockito.Mockito.mock;
2019
import 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

Comments
 (0)