Search in sources :

Example 1 with NodeService

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());
}
Also used : NodeInfo(org.elasticsearch.action.admin.cluster.node.info.NodeInfo) NodeService(org.elasticsearch.node.service.NodeService) Test(org.junit.Test) CrateUnitTest(io.crate.test.integration.CrateUnitTest)

Aggregations

CrateUnitTest (io.crate.test.integration.CrateUnitTest)1 NodeInfo (org.elasticsearch.action.admin.cluster.node.info.NodeInfo)1 NodeService (org.elasticsearch.node.service.NodeService)1 Test (org.junit.Test)1