use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ChangeWanStateRequestTest method testResumingWanState.
@Test
public void testResumingWanState() throws Exception {
ChangeWanStateRequest changeWanStateRequest = new ChangeWanStateRequest("schema", "publisher", true);
JsonObject jsonObject = new JsonObject();
changeWanStateRequest.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
assertNotEquals(ChangeWanStateRequest.SUCCESS, changeWanStateRequest.readResponse(result));
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ChangeWanStateRequestTest method testPausingWanState.
@Test
public void testPausingWanState() throws Exception {
ChangeWanStateRequest changeWanStateRequest = new ChangeWanStateRequest("schema", "publisher", false);
JsonObject jsonObject = new JsonObject();
changeWanStateRequest.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
assertNotEquals(ChangeWanStateRequest.SUCCESS, changeWanStateRequest.readResponse(result));
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ClearWanQueuesTest method testClearWanQueue.
@Test
public void testClearWanQueue() throws Exception {
ClearWanQueuesRequest clearWanQueuesRequest = new ClearWanQueuesRequest("schema", "publisher");
JsonObject jsonObject = new JsonObject();
clearWanQueuesRequest.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
assertNotEquals(ChangeWanStateRequest.SUCCESS, clearWanQueuesRequest.readResponse(result));
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ExecuteScriptRequestTest method testExecuteScriptRequest_withScriptException.
@Test
public void testExecuteScriptRequest_withScriptException() throws Exception {
ExecuteScriptRequest request = new ExecuteScriptRequest("print(;", "JavaScript", true, bindings);
JsonObject jsonObject = new JsonObject();
request.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
String response = (String) request.readResponse(result);
assertNotNull(response);
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ExecuteScriptRequestTest method testExecuteScriptRequest_withIllegalScriptEngine.
@Test
public void testExecuteScriptRequest_withIllegalScriptEngine() throws Exception {
ExecuteScriptRequest request = new ExecuteScriptRequest("script", "engine", true, bindings);
JsonObject jsonObject = new JsonObject();
request.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
String response = (String) request.readResponse(result);
assertContains(response, "IllegalArgumentException");
}
Aggregations