From 10f54688ae659c4ac3084769a985cce3c358169f Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Mon, 16 Mar 2020 09:00:04 +0100 Subject: [PATCH] Hotfix of tests --- .../java/org/jabref/gui/exporter/SaveDatabaseAction.java | 2 +- .../org/jabref/gui/exporter/SaveDatabaseActionTest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java index 4cdf82354fb..aedef2b2534 100644 --- a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java +++ b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java @@ -104,7 +104,7 @@ public void saveSelectedAsPlain() { * successful save. * @return true on successful save */ - private boolean saveAs(Path file, SaveDatabaseMode mode) { + boolean saveAs(Path file, SaveDatabaseMode mode) { BibDatabaseContext context = panel.getBibDatabaseContext(); // Close AutosaveManager and BackupManager for original library diff --git a/src/test/java/org/jabref/gui/exporter/SaveDatabaseActionTest.java b/src/test/java/org/jabref/gui/exporter/SaveDatabaseActionTest.java index 534823b4531..f4a91bae18e 100644 --- a/src/test/java/org/jabref/gui/exporter/SaveDatabaseActionTest.java +++ b/src/test/java/org/jabref/gui/exporter/SaveDatabaseActionTest.java @@ -91,7 +91,7 @@ public void saveShouldShowSaveAsIfDatabaseNotSelected() { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(file)); doReturn(true).when(saveDatabaseAction).saveAs(any(), any()); - saveDatabaseAction.save(dbContext); + saveDatabaseAction.save(); verify(saveDatabaseAction, times(1)).saveAs(file, SaveDatabaseAction.SaveDatabaseMode.NORMAL); } @@ -140,7 +140,7 @@ public void saveKeepsChangedFlag() throws Exception { BibDatabase database = new BibDatabase(List.of(firstEntry, secondEntry)); saveDatabaseAction = createSaveDatabaseActionForBibDatabase(database); - saveDatabaseAction.save(dbContext); + saveDatabaseAction.save(); assertEquals(database .getEntries().stream() @@ -151,7 +151,7 @@ public void saveKeepsChangedFlag() throws Exception { @Test public void saveShouldNotSaveDatabaseIfPathNotSet() { when(dbContext.getDatabasePath()).thenReturn(Optional.empty()); - boolean result = saveDatabaseAction.save(dbContext); + boolean result = saveDatabaseAction.save(); assertFalse(result); } }