use of com.hazelcast.cluster.ClusterState in project hazelcast by hazelcast.
the class NodeStateImplTest method toJson.
@Test
public void toJson() throws Exception {
ClusterState clusterState = ClusterState.ACTIVE;
com.hazelcast.instance.NodeState nodeState = com.hazelcast.instance.NodeState.PASSIVE;
Version clusterVersion = Version.of("3.8");
MemberVersion memberVersion = MemberVersion.of("3.9.0");
NodeState state = new NodeStateImpl(clusterState, nodeState, clusterVersion, memberVersion);
NodeState deserialized = new NodeStateImpl();
deserialized.fromJson(state.toJson());
assertEquals(clusterState, deserialized.getClusterState());
assertEquals(nodeState, deserialized.getNodeState());
assertEquals(clusterVersion, deserialized.getClusterVersion());
assertEquals(memberVersion, deserialized.getMemberVersion());
}
Aggregations