From 1e38d736e8464bee745d1a98a94d4470f397424c Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Sun, 8 Sep 2024 23:00:34 +0200 Subject: [PATCH] remove dialog service in test --- src/main/java/org/jabref/logic/util/NotificationService.java | 1 + .../chatting/chathistory/MVStoreChatHistoryStorageTest.java | 3 ++- .../ingestion/MVStoreFullyIngestedDocumentsTrackerTest.java | 4 ++-- .../logic/ai/summarization/MVStoreSummariesStorageTest.java | 4 ++-- .../java/org/jabref/logic/util/io/FileNameUniquenessTest.java | 1 - 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/jabref/logic/util/NotificationService.java b/src/main/java/org/jabref/logic/util/NotificationService.java index 0502e1e5062..135b650a761 100644 --- a/src/main/java/org/jabref/logic/util/NotificationService.java +++ b/src/main/java/org/jabref/logic/util/NotificationService.java @@ -1,5 +1,6 @@ package org.jabref.logic.util; +@FunctionalInterface public interface NotificationService { /** * Notify the user in a non-blocking way (i.e., in form of toast in a snackbar). diff --git a/src/test/java/org/jabref/logic/ai/chatting/chathistory/MVStoreChatHistoryStorageTest.java b/src/test/java/org/jabref/logic/ai/chatting/chathistory/MVStoreChatHistoryStorageTest.java index 35d1e7889b4..3bc66e16b8a 100644 --- a/src/test/java/org/jabref/logic/ai/chatting/chathistory/MVStoreChatHistoryStorageTest.java +++ b/src/test/java/org/jabref/logic/ai/chatting/chathistory/MVStoreChatHistoryStorageTest.java @@ -4,13 +4,14 @@ import org.jabref.gui.DialogService; import org.jabref.logic.ai.chatting.chathistory.storages.MVStoreChatHistoryStorage; +import org.jabref.logic.util.NotificationService; import static org.mockito.Mockito.mock; class MVStoreChatHistoryStorageTest extends ChatHistoryStorageTest { @Override ChatHistoryStorage makeStorage(Path path) { - return new MVStoreChatHistoryStorage(path, mock(DialogService.class)); + return new MVStoreChatHistoryStorage(path, mock(NotificationService.class)); } @Override diff --git a/src/test/java/org/jabref/logic/ai/ingestion/MVStoreFullyIngestedDocumentsTrackerTest.java b/src/test/java/org/jabref/logic/ai/ingestion/MVStoreFullyIngestedDocumentsTrackerTest.java index a227cfd2cd8..1626557c274 100644 --- a/src/test/java/org/jabref/logic/ai/ingestion/MVStoreFullyIngestedDocumentsTrackerTest.java +++ b/src/test/java/org/jabref/logic/ai/ingestion/MVStoreFullyIngestedDocumentsTrackerTest.java @@ -2,15 +2,15 @@ import java.nio.file.Path; -import org.jabref.gui.DialogService; import org.jabref.logic.ai.ingestion.storages.MVStoreFullyIngestedDocumentsTracker; +import org.jabref.logic.util.NotificationService; import static org.mockito.Mockito.mock; class MVStoreFullyIngestedDocumentsTrackerTest extends FullyIngestedDocumentsTrackerTest { @Override FullyIngestedDocumentsTracker makeTracker(Path path) { - return new MVStoreFullyIngestedDocumentsTracker(path, mock(DialogService.class)); + return new MVStoreFullyIngestedDocumentsTracker(path, mock(NotificationService.class)); } @Override diff --git a/src/test/java/org/jabref/logic/ai/summarization/MVStoreSummariesStorageTest.java b/src/test/java/org/jabref/logic/ai/summarization/MVStoreSummariesStorageTest.java index f3334fa693b..0beedc7e8bf 100644 --- a/src/test/java/org/jabref/logic/ai/summarization/MVStoreSummariesStorageTest.java +++ b/src/test/java/org/jabref/logic/ai/summarization/MVStoreSummariesStorageTest.java @@ -2,15 +2,15 @@ import java.nio.file.Path; -import org.jabref.gui.DialogService; import org.jabref.logic.ai.summarization.storages.MVStoreSummariesStorage; +import org.jabref.logic.util.NotificationService; import static org.mockito.Mockito.mock; class MVStoreSummariesStorageTest extends SummariesStorageTest { @Override SummariesStorage makeSummariesStorage(Path path) { - return new MVStoreSummariesStorage(path, mock(DialogService.class)); + return new MVStoreSummariesStorage(path, mock(NotificationService.class)); } @Override diff --git a/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java b/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java index 4dfd5d51fb3..bc0a3e63f84 100644 --- a/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java +++ b/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java @@ -56,7 +56,6 @@ void getNonOverWritingFileNameReturnsUniqueNameOverNConflicts() throws IOExcepti @Test void isDuplicatedFileWithNoSimilarNames() throws IOException { - DialogService dialogService = mock(DialogService.class); String filename1 = "file1.txt"; Path filePath1 = tempDir.resolve(filename1); Files.createFile(filePath1);