use of io.crate.ClusterIdService 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()));
}
Aggregations