use of com.faforever.client.preferences.PreferencesService in project downlords-faf-client by FAForever.
the class PrivateChatTabControllerTest method setUp.
@Before
public void setUp() throws IOException {
Vault vault = new Vault();
vault.setReplayDownloadUrlFormat("test.de");
when(clientProperties.getVault()).thenReturn(vault);
PreferencesService preferencesService = new PreferencesService();
preferencesService.postConstruct();
preferencesService.getPreferences().getMainWindow().setLastView(NavigationItem.CHAT.name());
instance = new PrivateChatTabController(clanService, userService, platformService, preferencesService, playerService, timeService, i18n, imageUploadService, urlPreviewResolver, notificationService, reportingService, uiService, autoCompletionHelper, eventBus, audioService, chatService, mapService, webViewConfigurer, countryFlagService, replayService, clientProperties, externalReplayInfoGenerator);
playerName = "testUser";
Player player = new Player(playerName);
when(playerService.getPlayerForUsername(playerName)).thenReturn(player);
when(userService.getUsername()).thenReturn(playerName);
when(uiService.getThemeFileUrl(CHAT_CONTAINER)).then(invocation -> getThemeFileUrl(invocation.getArgument(0)));
TabPane tabPane = new TabPane();
tabPane.setSkin(new TabPaneSkin(tabPane));
loadFxml("theme/chat/private_chat_tab.fxml", clazz -> {
if (clazz == PrivateUserInfoController.class) {
return privateUserInfoController;
}
if (clazz == GameDetailController.class) {
return gameDetailController;
}
if (clazz == WatchButtonController.class) {
return watchButtonController;
}
return instance;
});
instance.setReceiver(playerName);
WaitForAsyncUtils.asyncFx(() -> {
getRoot().getChildren().setAll(tabPane);
tabPane.getTabs().add(instance.getRoot());
});
WaitForAsyncUtils.waitForFxEvents();
verify(webViewConfigurer).configureWebView(instance.messagesWebView);
}
use of com.faforever.client.preferences.PreferencesService in project downlords-faf-client by FAForever.
the class GamePathHandlerTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
PreferencesService preferenceService = new PreferencesService();
instance = new GamePathHandler(notificationService, i18n, eventBus, preferenceService);
}
use of com.faforever.client.preferences.PreferencesService in project downlords-faf-client by FAForever.
the class TransientNotificationControllerTest method setUp.
@Before
public void setUp() throws Exception {
PreferencesService preferencesService = new PreferencesService();
preferencesService.postConstruct();
instance = new TransientNotificationController(preferencesService);
loadFxml("theme/transient_notification.fxml", clazz -> instance);
}
Aggregations