StringToObjectNodeConverter implements Converter<String, ObjectNode> { @Override public ObjectNode convert(String source) { try { return objectMapper.readValue(source, ObjectNode.class); } catch (IOException e) { throw new IllegalArgumentException("Could not convert to ObjectNode: " + source, e); } }  @Override ObjectNode convert(String source);  }
@Test public void testConvert() throws Exception { String source = "{ \"foo\": true }"; ObjectNode converted = new StringToObjectNodeConverter().convert(source); assertThat(converted.get("foo").getBooleanValue(), is(true)); }