Skip to content

Commit 473224e

Browse files
committed
fix mocks
1 parent eeadfd8 commit 473224e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

jabsrv/src/test/java/org/jabref/http/server/ServerTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
import org.jabref.http.dto.GsonFactory;
1212
import org.jabref.http.server.cayw.format.FormatterService;
1313
import org.jabref.http.server.services.FilesToServe;
14+
import org.jabref.logic.FilePreferences;
1415
import org.jabref.logic.bibtex.FieldPreferences;
1516
import org.jabref.logic.importer.ImportFormatPreferences;
1617
import org.jabref.logic.preferences.CliPreferences;
1718
import org.jabref.logic.preferences.LastFilesOpenedPreferences;
1819
import org.jabref.model.entry.BibEntryPreferences;
20+
import org.jabref.model.metadata.UserHostInfo;
1921

2022
import com.google.gson.Gson;
2123
import org.glassfish.hk2.utilities.binding.AbstractBinder;
@@ -128,6 +130,11 @@ private static void initializePreferencesService() {
128130
LastFilesOpenedPreferences lastFilesOpenedPreferences = mock(LastFilesOpenedPreferences.class);
129131
when(preferences.getLastFilesOpenedPreferences()).thenReturn(lastFilesOpenedPreferences);
130132
when(lastFilesOpenedPreferences.getLastFilesOpened()).thenReturn(FXCollections.emptyObservableList());
133+
134+
FilePreferences filePreferences = mock(FilePreferences.class);
135+
when(preferences.getFilePreferences()).thenReturn(filePreferences);
136+
when(filePreferences.getUserAndHost()).thenReturn(new UserHostInfo("user", "host").getUserHostString());
137+
when(importFormatPreferences.filePreferences()).thenReturn(filePreferences);
131138
}
132139

133140
protected void addGlobalExceptionMapperToResourceConfig(ResourceConfig resourceConfig) {

0 commit comments

Comments
 (0)