use of com.hazelcast.internal.management.request.ChangeClusterStateRequest in project hazelcast by hazelcast.
the class ChangeClusterStateRequestTest method testChangeClusterState_withNonExistent.
@Test
public void testChangeClusterState_withNonExistent() throws Exception {
ChangeClusterStateRequest changeClusterStateRequest = new ChangeClusterStateRequest("MURAT");
JsonObject jsonObject = new JsonObject();
changeClusterStateRequest.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
String resultString = (String) changeClusterStateRequest.readResponse(result);
assertTrue(resultString.startsWith("FAILURE"));
}
use of com.hazelcast.internal.management.request.ChangeClusterStateRequest in project hazelcast by hazelcast.
the class ChangeClusterStateRequestTest method testChangeClusterState_withInvalidState.
@Test
public void testChangeClusterState_withInvalidState() throws Exception {
ChangeClusterStateRequest changeClusterStateRequest = new ChangeClusterStateRequest("IN_TRANSITION");
JsonObject jsonObject = new JsonObject();
changeClusterStateRequest.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
String resultString = (String) changeClusterStateRequest.readResponse(result);
assertTrue(resultString.startsWith("FAILURE"));
}
use of com.hazelcast.internal.management.request.ChangeClusterStateRequest in project hazelcast by hazelcast.
the class ChangeClusterStateRequestTest method testChangeClusterState.
@Test
public void testChangeClusterState() throws Exception {
ChangeClusterStateRequest changeClusterStateRequest = new ChangeClusterStateRequest("FROZEN");
JsonObject jsonObject = new JsonObject();
changeClusterStateRequest.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
assertEquals("SUCCESS", changeClusterStateRequest.readResponse(result));
assertEquals(ClusterState.valueOf("FROZEN"), cluster.getClusterState());
}
Aggregations