Search in sources :

Example 21 with Preferences

use of com.faforever.client.preferences.Preferences in project downlords-faf-client by FAForever.

the class MapVaultControllerTest method setUp.

@Before
public void setUp() throws Exception {
    when(preferencesService.getPreferences()).thenReturn(new Preferences());
    instance = new MapVaultController(mapService, i18n, eventBus, preferencesService, uiService, notificationService);
    doAnswer(invocation -> {
        MapDetailController controller = mock(MapDetailController.class);
        when(controller.getRoot()).thenReturn(new Pane());
        return controller;
    }).when(uiService).loadFxml("theme/vault/map/map_detail.fxml");
    doAnswer(invocation -> {
        MapCardController controller = mock(MapCardController.class);
        when(controller.getRoot()).thenReturn(new Pane());
        return controller;
    }).when(uiService).loadFxml("theme/vault/map/map_card.fxml");
    loadFxml("theme/vault/map/map_vault.fxml", clazz -> {
        if (clazz == SearchController.class) {
            return searchController;
        }
        if (clazz == LogicalNodeController.class) {
            return logicalNodeController;
        }
        if (clazz == SpecificationController.class) {
            return specificationController;
        }
        return instance;
    });
}
Also used : Preferences(com.faforever.client.preferences.Preferences) Pane(javafx.scene.layout.Pane) Before(org.junit.Before)

Aggregations

Preferences (com.faforever.client.preferences.Preferences)21 Before (org.junit.Before)16 Pane (javafx.scene.layout.Pane)6 ClientProperties (com.faforever.client.config.ClientProperties)3 Clan (com.faforever.client.clan.Clan)2 Vault (com.faforever.client.config.ClientProperties.Vault)2 NumberFormat (java.text.NumberFormat)2 TabPane (javafx.scene.control.TabPane)2 NumberStringConverter (javafx.util.converter.NumberStringConverter)2 ChatColorMode (com.faforever.client.chat.ChatColorMode)1 AvatarBean (com.faforever.client.chat.avatar.AvatarBean)1 ClanTooltipController (com.faforever.client.clan.ClanTooltipController)1 Website (com.faforever.client.config.ClientProperties.Website)1 Controller (com.faforever.client.fx.Controller)1 PATH_STRING_CONVERTER (com.faforever.client.fx.JavaFxUtil.PATH_STRING_CONVERTER)1 StringListCell (com.faforever.client.fx.StringListCell)1 Game (com.faforever.client.game.Game)1 I18n (com.faforever.client.i18n.I18n)1 Action (com.faforever.client.notification.Action)1 NotificationService (com.faforever.client.notification.NotificationService)1