Test: fix npe

This commit is contained in:
Martijn van Groningen 2015-03-02 16:38:55 +01:00
parent 2b00ecb5b5
commit 68da7c05ee
1 changed files with 2 additions and 1 deletions

View File

@ -1053,7 +1053,8 @@ public class DiscoveryWithServiceDisruptionsTests extends ElasticsearchIntegrati
ClusterState state = getNodeClusterState(node);
String failMsgSuffix = "cluster_state:\n" + state.prettyPrint();
assertThat("wrong node count on [" + node + "]. " + failMsgSuffix, state.nodes().size(), equalTo(nodes.size()));
assertThat("wrong master on node [" + node + "]. " + failMsgSuffix, state.nodes().masterNode().name(), equalTo(masterNode));
String otherMasterNodeName = state.nodes().masterNode() != null ? state.nodes().masterNode().name() : null;
assertThat("wrong master on node [" + node + "]. " + failMsgSuffix, otherMasterNodeName, equalTo(masterNode));
}
}