use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.
the class TransientNotificationsControllerTest method setUp.
@Before
public void setUp() throws Exception {
instance = new TransientNotificationsController(uiService, preferencesService);
Preferences preferences = new Preferences();
notificationPrefs = preferences.getNotification();
when(preferencesService.getPreferences()).thenReturn(preferences);
loadFxml("theme/transient_notifications.fxml", clazz -> instance);
}
use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.
the class GamesTilesContainerControllerTest method setUp.
@Before
public void setUp() throws Exception {
instance = new GamesTilesContainerController(uiService, preferencesService);
when(uiService.loadFxml("theme/play/game_card.fxml")).thenReturn(gameTileController);
preferences = new Preferences();
when(preferencesService.getPreferences()).thenReturn(preferences);
when(gameTileController.getRoot()).thenReturn(new Pane()).thenReturn(new FlowPane()).thenReturn(new StackPane());
loadFxml("theme/play/games_tiles_container.fxml", clazz -> instance);
}
use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.
the class GamesTableControllerTest method setUp.
@Before
public void setUp() throws Exception {
instance = new GamesTableController(mapService, joinGameHelper, i18n, uiService, preferencesService);
when(preferencesService.getPreferences()).thenReturn(new Preferences());
loadFxml("theme/play/games_table.fxml", param -> instance);
Platform.runLater(() -> getRoot().getChildren().addAll(instance.getRoot()));
WaitForAsyncUtils.waitForFxEvents();
}
use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.
the class LoginControllerTest method setUp.
@Before
public void setUp() throws Exception {
ClientProperties clientProperties = new ClientProperties();
instance = new LoginController(userService, preferencesService, platformService, clientProperties);
loadFxml("theme/login.fxml", param -> instance);
Website website = clientProperties.getWebsite();
website.setCreateAccountUrl("create");
website.setForgotPasswordUrl("forgot");
when(preferencesService.getPreferences()).thenReturn(new Preferences());
}
use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.
the class ModVaultControllerTest method setUp.
@Before
public void setUp() throws Exception {
when(preferencesService.getPreferences()).thenReturn(new Preferences());
instance = new ModVaultController(modService, i18n, eventBus, preferencesService, uiService, notificationService);
doAnswer(invocation -> {
ModCardController modCardController = mock(ModCardController.class);
when(modCardController.getRoot()).then(invocation1 -> new Pane());
return modCardController;
}).when(uiService).loadFxml("theme/vault/mod/mod_card.fxml");
doAnswer(invocation -> {
modDetailController = mock(ModDetailController.class);
when(modDetailController.getRoot()).then(invocation1 -> new Pane());
return modDetailController;
}).when(uiService).loadFxml("theme/vault/mod/mod_detail.fxml");
ModVersion modVersion = ModInfoBeanBuilder.create().defaultValues().get();
when(modService.getHighestRatedMods(100, 1)).thenReturn(CompletableFuture.completedFuture(Collections.singletonList(modVersion)));
when(modService.getNewestMods(100, 1)).thenReturn(CompletableFuture.completedFuture(Collections.singletonList(modVersion)));
loadFxml("theme/vault/mod/mod_vault.fxml", clazz -> {
if (clazz == LogicalNodeController.class) {
return logicalNodeController;
}
if (clazz == SearchController.class) {
return searchController;
}
if (clazz == SpecificationController.class) {
return specificationController;
}
return instance;
});
}
Aggregations