JsonObjectMapper { public String writeValueAsString(final Object object) throws JsonProcessingException { return snakeCaseMapper.writeValueAsString(object); } 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 writeValueAsString_convertsObjectToSnakeCaseJson() throws JsonProcessingException { final StringGenerationParameters generationParameters = new StringGenerationParameters(); generationParameters.setExcludeLower(true); generationParameters.setIncludeSpecial(true); final String expectedResult = "{\"exclude_lower\":true,\"include_special\":true}"; final String actualValue = new JsonObjectMapper().writeValueAsString(generationParameters); assertThat(actualValue, equalTo(expectedResult)); }