@Test public void properMessageIsConstructed_forKeywordConditionMessage() { assertThat(new EvaluateCondition(newArrayList()).toMessage()).isEqualTo("{\"evaluate_condition\":[]}"); assertThat(new EvaluateCondition(newArrayList("a")).toMessage()).isEqualTo("{\"evaluate_condition\":[\"a\"]}"); assertThat(new EvaluateCondition(newArrayList("a", "b")).toMessage()) .isEqualTo("{\"evaluate_condition\":[\"a\",\"b\"]}"); assertThat(new EvaluateCondition(newArrayList("a", "b", "c")).toMessage()) .isEqualTo("{\"evaluate_condition\":[\"a\",\"b\",\"c\"]}"); }
@Override public String toMessage() { try { final Map<String, Object> value = ImmutableMap.of("evaluate_condition", conditionWithArguments); return mapper.writeValueAsString(value); } catch (final IOException e) { throw new ResponseException("Unable to serialize breakpoint condition response arguments to json", e); } }
EvaluateCondition implements ServerResponseOnShouldContinue { @Override public String toMessage() { try { final Map<String, Object> value = ImmutableMap.of("evaluate_condition", conditionWithArguments); return mapper.writeValueAsString(value); } catch (final IOException e) { throw new ResponseException("Unable to serialize breakpoint condition response arguments to json", e); } } }
EvaluateCondition implements ServerResponseOnShouldContinue { @Override public String toMessage() { try { final Map<String, Object> value = ImmutableMap.of("evaluate_condition", conditionWithArguments); return mapper.writeValueAsString(value); } catch (final IOException e) { throw new ResponseException("Unable to serialize breakpoint condition response arguments to json", e); } } EvaluateCondition(final List<String> conditionWithArguments); @VisibleForTesting  EvaluateCondition(final ObjectMapper mapper, final List<String> conditionWithArguments); }
EvaluateCondition implements ServerResponseOnShouldContinue { @Override public String toMessage() { try { final Map<String, Object> value = ImmutableMap.of("evaluate_condition", conditionWithArguments); return mapper.writeValueAsString(value); } catch (final IOException e) { throw new ResponseException("Unable to serialize breakpoint condition response arguments to json", e); } } EvaluateCondition(final List<String> conditionWithArguments); @VisibleForTesting  EvaluateCondition(final ObjectMapper mapper, final List<String> conditionWithArguments); @Override String toMessage(); }
EvaluateCondition implements ServerResponseOnShouldContinue { @Override public String toMessage() { try { final Map<String, Object> value = ImmutableMap.of("evaluate_condition", conditionWithArguments); return mapper.writeValueAsString(value); } catch (final IOException e) { throw new ResponseException("Unable to serialize breakpoint condition response arguments to json", e); } } EvaluateCondition(final List<String> conditionWithArguments); @VisibleForTesting  EvaluateCondition(final ObjectMapper mapper, final List<String> conditionWithArguments); @Override String toMessage();  }