JsonObjectMapper { public <T> T readValue(final String stringValue, final Class<T> type) throws IOException { return snakeCaseMapper.readValue(stringValue, type); } JsonObjectMapper(); String writeValueAsString(final Object object); T deserializeBackwardsCompatibleValue(final String stringValue, final Class<T> type); T readValue(final String stringValue, final Class<T> type); JsonNode readTree(final String stringValue);  }
@Test public void readValue_shouldConvertJsonStringsInSnakeCaseToObjects() throws IOException { final String testSnakeCaseString = "{\"exclude_lower\":true,\"include_special\":true}"; final StringGenerationParameters generationParameters = new StringGenerationParameters(); generationParameters.setExcludeLower(true); generationParameters.setIncludeSpecial(true); final StringGenerationParameters actualGenerationParameters = new JsonObjectMapper() .readValue(testSnakeCaseString, StringGenerationParameters.class); assertThat(generationParameters, equalTo(actualGenerationParameters)); }