@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)); }
@Test public void testSerialization() throws IllegalAccessException { ChangeWanStateRequest changeWanStateRequest1 = new ChangeWanStateRequest("schema", "publisher", false); JsonObject jsonObject = changeWanStateRequest1.toJson(); ChangeWanStateRequest changeWanStateRequest2 = new ChangeWanStateRequest(); changeWanStateRequest2.fromJson(jsonObject); assertEquals( changeWanStateRequest1.getPublisherName(), changeWanStateRequest2.getPublisherName()); assertEquals(changeWanStateRequest1.getSchemeName(), changeWanStateRequest2.getSchemeName()); assertEquals(changeWanStateRequest1.isStart(), changeWanStateRequest2.isStart()); }