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