use of com.faforever.client.query.SpecificationController in project downlords-faf-client by FAForever.
the class SearchControllerTest method setUp.
@Before
public void setUp() throws Exception {
when(uiService.loadFxml("theme/vault/search/logical_node.fxml")).thenAnswer(invocation -> {
LogicalNodeController controller = mock(LogicalNodeController.class);
controller.logicalOperatorField = new ChoiceBox<>();
controller.specificationController = mock(SpecificationController.class);
controller.specificationController.propertyField = new ComboBox<>();
controller.specificationController.operationField = new ChoiceBox<>();
controller.specificationController.valueField = new ComboBox<>();
when(controller.getRoot()).thenReturn(new Pane());
return controller;
});
when(preferencesService.getPreferences()).thenReturn(new Preferences());
instance = new SearchController(uiService, i18n, preferencesService);
loadFxml("theme/vault/search/search.fxml", clazz -> {
if (SpecificationController.class.isAssignableFrom(clazz)) {
return specificationController;
}
if (LogicalNodeController.class.isAssignableFrom(clazz)) {
return logicalNodeController;
}
return instance;
});
instance.setSearchableProperties(SearchableProperties.GAME_PROPERTIES);
instance.setSortConfig(preferencesService.getPreferences().getVaultPrefs().onlineReplaySortConfigProperty());
}
Aggregations