BoundTransportAddress boundAddress = mock(BoundTransportAddress.class);
TransportAddress transportAddress = new InetSocketTransportAddress(
InetAddress.getLocalHost().getHostName(), 4200);
SettableFuture<ClusterId> clusterIdFuture = SettableFuture.create();
clusterIdFuture.set(new ClusterId(UUID.randomUUID()));
when(clusterIdService.clusterId()).thenReturn(clusterIdFuture);
when(clusterService.localNode()).thenReturn(discoveryNode);
when(discoveryNode.isMasterNode()).thenReturn(true);
when(httpServerTransport.boundAddress()).thenReturn(boundAddress);
when(boundAddress.publishAddress()).thenReturn(transportAddress);