when(metaData.transientSettings()).thenReturn(ImmutableSettings.EMPTY);
when(state.metaData()).thenReturn(metaData);
when(clusterService.state()).thenReturn(state);
bind(ClusterService.class).toInstance(clusterService);
bind(Settings.class).toInstance(ImmutableSettings.EMPTY);
OsService osService = mock(OsService.class);
OsStats osStats = mock(OsStats.class);
when(osService.stats()).thenReturn(osStats);
when(osStats.loadAverage()).thenReturn(new double[]{1, 5, 15});
bind(OsService.class).toInstance(osService);
Discovery discovery = mock(Discovery.class);
bind(Discovery.class).toInstance(discovery);
DiscoveryNode node = mock(DiscoveryNode.class);