use of org.elasticsearch.monitor.MonitorService in project crate by crate.
the class NodeStatsContextFieldResolverTest method setup.
@Before
public void setup() throws UnknownHostException {
final OsService osService = mock(OsService.class);
final OsStats osStats = mock(OsStats.class);
final MonitorService monitorService = mock(MonitorService.class);
when(monitorService.osService()).thenReturn(osService);
when(osService.stats()).thenReturn(osStats);
DiscoveryNode discoveryNode = newNode("node_name", "node_id");
postgresAddress = new TransportAddress(Inet4Address.getLocalHost(), 5432);
resolver = new NodeStatsContextFieldResolver(() -> discoveryNode, monitorService, () -> null, () -> new HttpStats(20L, 30L), mock(ThreadPool.class), new ExtendedNodeInfo(), () -> new ConnectionStats(2L, 4L), () -> postgresAddress, () -> 12L, () -> 1L);
}
Aggregations