use of org.elasticsearch.node.service.NodeService in project crate by crate.
the class NodePortExpressionTest method testNoHttpServerAvailable.
@Test
public void testNoHttpServerAvailable() throws Exception {
NodeService nodeService = mock(NodeService.class);
NodeInfo nodeInfo = mock(NodeInfo.class);
when(nodeService.info()).thenReturn(nodeInfo);
when(nodeInfo.getHttp()).thenReturn(null);
NodePortExpression nodePortExpression = new NodePortExpression(nodeService);
Object value = nodePortExpression.getChildImplementation("http").value();
assertThat(value, Matchers.nullValue());
}
Aggregations