JacksonRpcResponseExtractor implements RpcResponseExtractor<JsonNode> { @Override public JsonNode extractData(RpcResponse response) throws RpcResponseExtractionException { try { return mapper.readValue(response.toString(), JsonNode.class); } catch (IOException e) { throw new RpcResponseExtractionException(response, "error mapping RPC response to JsonNode", e); } }  ObjectMapper getJsonMapper(); void setJsonMapper(ObjectMapper mapper); @Override JsonNode extractData(RpcResponse response);  }
@Test public void testExtractData() throws Exception { JacksonRpcResponseExtractor e = new JacksonRpcResponseExtractor(); JsonNode json = e.extractData(new RpcResponse("{\"foo\":\"bar\",\"baz\":23}")); assertThat(json.get("foo").asText(), equalTo("bar")); assertThat(json.get("baz").asInt(), equalTo(23)); }