|
8 | 8 | import org.jabref.logic.exporter.SavePreferences; |
9 | 9 | import org.jabref.model.metadata.SaveOrderConfig; |
10 | 10 | import org.jabref.preferences.PreferencesService; |
| 11 | + |
11 | 12 | import org.junit.jupiter.api.BeforeEach; |
12 | 13 | import org.junit.jupiter.api.Test; |
13 | 14 | import org.junit.jupiter.api.io.TempDir; |
|
17 | 18 | import static org.mockito.Mockito.mock; |
18 | 19 | import static org.mockito.Mockito.when; |
19 | 20 |
|
20 | | - |
21 | 21 | class ArgumentProcessorTest { |
22 | 22 |
|
23 | 23 | private ArgumentProcessor processor; |
24 | | - |
25 | 24 | private final PreferencesService preferencesService = mock(PreferencesService.class, Answers.RETURNS_DEEP_STUBS); |
26 | 25 | private final SavePreferences savePreferences = mock(SavePreferences.class, Answers.RETURNS_DEEP_STUBS); |
27 | 26 |
|
28 | | - |
29 | 27 | @BeforeEach() |
30 | 28 | void setup() { |
31 | 29 | when(savePreferences.getSaveOrder()).thenReturn(SaveOrderConfig.getDefaultSaveOrder()); |
32 | 30 | when(preferencesService.getSavePreferences()).thenReturn(savePreferences); |
33 | 31 | } |
34 | 32 |
|
35 | | - |
36 | 33 | @Test |
37 | | - void testAux(@TempDir Path tempDir) throws Exception { |
| 34 | + void testAuxImport(@TempDir Path tempDir) throws Exception { |
38 | 35 |
|
39 | 36 | String auxFile = Path.of(AuxCommandLineTest.class.getResource("paper.aux").toURI()).toAbsolutePath().toString(); |
40 | 37 | String originBib = Path.of(AuxCommandLineTest.class.getResource("origin.bib").toURI()).toAbsolutePath().toString(); |
41 | 38 |
|
42 | | - Path outputBib = tempDir.resolve("output.bib").toAbsolutePath(); |
| 39 | + Path outputBib = tempDir.resolve("output.bisb").toAbsolutePath(); |
43 | 40 | String outputBibFile = outputBib.toAbsolutePath().toString(); |
44 | 41 |
|
45 | 42 | List<String> args = List.of("--nogui", "--debug", "--aux", auxFile + "," + outputBibFile, originBib); |
46 | 43 |
|
47 | 44 | processor = new ArgumentProcessor(args.toArray(String[]::new), Mode.INITIAL_START, preferencesService); |
48 | 45 |
|
49 | 46 | assertTrue(Files.exists(outputBib)); |
50 | | - |
51 | 47 | } |
52 | | - |
53 | 48 | } |
0 commit comments