DisconnectExecution implements ServerResponseOnShouldContinue { @Override public String toMessage() { try { final List<Object> arguments = new ArrayList<>(); final Map<String, Object> value = ImmutableMap.of("disconnect", arguments); return mapper.writeValueAsString(value); } catch (final IOException e) { throw new ResponseException("Unable to serialize disconnect response arguments to json", e); } } DisconnectExecution(); @VisibleForTesting  DisconnectExecution(final ObjectMapper mapper); @Override String toMessage();  }
@Test public void properMessageIsConstructed_forDisconnectExecutionMessage() { assertThat(new DisconnectExecution().toMessage()).isEqualTo("{\"disconnect\":[]}"); }