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