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