@Test public void serializeNumericResult() throws Exception { ResultSerializer resultSerializer = new DetailedResultSerializer(); String message = resultSerializer.serialize(dummyServer(), dummyQuery(), numericResult()); assertThat(message) .contains("\"host\":\"host.example.net\"") .contains("\"attributeName\":\"ObjectPendingFinalizationCount\"") .contains("\"typeName\":\"type=Memory\"") .contains("\"value\":10") .contains("\"epoch\":0") .contains("\"keyAlias\":\"MemoryAlias\""); }
@Override public String serialize(final Server server, final Query query, final Result result) throws IOException { return objectMapper.writeValueAsString(new KResult(server, result)); }
DetailedResultSerializer implements ResultSerializer { @Override public String serialize(final Server server, final Query query, final Result result) throws IOException { return objectMapper.writeValueAsString(new KResult(server, result)); } }
DetailedResultSerializer implements ResultSerializer { @Override public String serialize(final Server server, final Query query, final Result result) throws IOException { return objectMapper.writeValueAsString(new KResult(server, result)); } @JsonCreator  DetailedResultSerializer(); }
DetailedResultSerializer implements ResultSerializer { @Override public String serialize(final Server server, final Query query, final Result result) throws IOException { return objectMapper.writeValueAsString(new KResult(server, result)); } @JsonCreator  DetailedResultSerializer(); @Override String serialize(final Server server, final Query query, final Result result); }
DetailedResultSerializer implements ResultSerializer { @Override public String serialize(final Server server, final Query query, final Result result) throws IOException { return objectMapper.writeValueAsString(new KResult(server, result)); } @JsonCreator  DetailedResultSerializer(); @Override String serialize(final Server server, final Query query, final Result result);  }