@Test public void testWriteString() throws Exception { NpmSearchResponseMapper underTest = new NpmSearchResponseMapper(); NpmSearchResponse response = buildSearchResponse(); String result = underTest.writeString(response); try (InputStream in = getClass().getResourceAsStream("sample-search-response.json")) { String expected = CharStreams.toString(new InputStreamReader(in, StandardCharsets.UTF_8)); assertThat(result, JsonMatchers.jsonEquals(expected)); } }
public String writeString(final NpmSearchResponse searchResponse) throws JsonProcessingException { return mapper.writeValueAsString(searchResponse); }
NpmSearchResponseMapper extends ComponentSupport { public String writeString(final NpmSearchResponse searchResponse) throws JsonProcessingException { return mapper.writeValueAsString(searchResponse); } }
NpmSearchResponseMapper extends ComponentSupport { public String writeString(final NpmSearchResponse searchResponse) throws JsonProcessingException { return mapper.writeValueAsString(searchResponse); } NpmSearchResponseMapper(); }
NpmSearchResponseMapper extends ComponentSupport { public String writeString(final NpmSearchResponse searchResponse) throws JsonProcessingException { return mapper.writeValueAsString(searchResponse); } NpmSearchResponseMapper(); String writeString(final NpmSearchResponse searchResponse); NpmSearchResponse readFromInputStream(final InputStream searchResponseStream); }
NpmSearchResponseMapper extends ComponentSupport { public String writeString(final NpmSearchResponse searchResponse) throws JsonProcessingException { return mapper.writeValueAsString(searchResponse); } NpmSearchResponseMapper(); String writeString(final NpmSearchResponse searchResponse); NpmSearchResponse readFromInputStream(final InputStream searchResponseStream);  }