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