Search in sources :

Example 1 with ConfigManager

use of com.netflix.exhibitor.core.config.ConfigManager in project exhibitor by soabase.

the class TestMonitorRunningInstance method makeMockExhibitor.

private Exhibitor makeMockExhibitor(InstanceConfig config, String us) {
    Preferences preferences = Mockito.mock(Preferences.class);
    ControlPanelValues controlPanelValues = new ControlPanelValues(preferences) {

        @Override
        public boolean isSet(ControlPanelTypes type) throws Exception {
            return true;
        }
    };
    ConfigManager configManager = Mockito.mock(ConfigManager.class);
    Mockito.when(configManager.getConfig()).thenReturn(config);
    Exhibitor mockExhibitor = Mockito.mock(Exhibitor.class, Mockito.RETURNS_MOCKS);
    Mockito.when(mockExhibitor.getConfigManager()).thenReturn(configManager);
    Mockito.when(mockExhibitor.getThisJVMHostname()).thenReturn(us);
    Mockito.when(mockExhibitor.getControlPanelValues()).thenReturn(controlPanelValues);
    return mockExhibitor;
}
Also used : ControlPanelValues(com.netflix.exhibitor.core.controlpanel.ControlPanelValues) ControlPanelTypes(com.netflix.exhibitor.core.controlpanel.ControlPanelTypes) Exhibitor(com.netflix.exhibitor.core.Exhibitor) Preferences(java.util.prefs.Preferences) ConfigManager(com.netflix.exhibitor.core.config.ConfigManager)

Aggregations

Exhibitor (com.netflix.exhibitor.core.Exhibitor)1 ConfigManager (com.netflix.exhibitor.core.config.ConfigManager)1 ControlPanelTypes (com.netflix.exhibitor.core.controlpanel.ControlPanelTypes)1 ControlPanelValues (com.netflix.exhibitor.core.controlpanel.ControlPanelValues)1 Preferences (java.util.prefs.Preferences)1