DefaultHttpJsonResponse implements HttpJsonResponse { @Override public String asString() { return responseBody; } DefaultHttpJsonResponse(String response, int responseCode); @Override String asString(); @Override T asDto(Class<T> dtoInterface); @Override List<T> asList(Class<T> dtoInterface); @Override @SuppressWarnings("unchecked") Map<String, String> asProperties(); @Override T as(Class<T> clazz, Type genericType); @Override int getResponseCode();  }
@Test public void shouldReturnStringAsItIsIfStringIsRequested() throws Exception { final DefaultHttpJsonResponse response = new DefaultHttpJsonResponse("string response", 200); assertEquals(response.asString(), "string response"); }