Search in sources :

Example 1 with ExtendedNetworkInfo

use of io.crate.monitor.ExtendedNetworkInfo in project crate by crate.

the class PingTaskTest method prepare.

@Before
public void prepare() throws Exception {
    clusterService = mock(ClusterService.class);
    clusterIdService = mock(ClusterIdService.class);
    DiscoveryNode discoveryNode = mock(DiscoveryNode.class);
    SettableFuture<ClusterId> clusterIdFuture = SettableFuture.create();
    clusterIdFuture.set(new ClusterId());
    when(clusterIdService.clusterId()).thenReturn(clusterIdFuture);
    when(clusterService.localNode()).thenReturn(discoveryNode);
    when(discoveryNode.isMasterNode()).thenReturn(true);
    extendedNodeInfo = mock(ExtendedNodeInfo.class);
    when(extendedNodeInfo.networkInfo()).thenReturn(new ExtendedNetworkInfo(ExtendedNetworkInfo.NA_INTERFACE));
    when(extendedNodeInfo.osInfo()).thenReturn(new ExtendedOsInfo(Collections.emptyMap()));
}
Also used : DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) ClusterService(org.elasticsearch.cluster.ClusterService) ClusterId(io.crate.ClusterId) ExtendedNodeInfo(io.crate.monitor.ExtendedNodeInfo) ClusterIdService(io.crate.ClusterIdService) ExtendedOsInfo(io.crate.monitor.ExtendedOsInfo) ExtendedNetworkInfo(io.crate.monitor.ExtendedNetworkInfo) Before(org.junit.Before)

Aggregations

ClusterId (io.crate.ClusterId)1 ClusterIdService (io.crate.ClusterIdService)1 ExtendedNetworkInfo (io.crate.monitor.ExtendedNetworkInfo)1 ExtendedNodeInfo (io.crate.monitor.ExtendedNodeInfo)1 ExtendedOsInfo (io.crate.monitor.ExtendedOsInfo)1 ClusterService (org.elasticsearch.cluster.ClusterService)1 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)1 Before (org.junit.Before)1