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