@Test public void shouldReturnEmptyInputStream() throws Exception { final InputStream value = Defaults.emptyStream().apply(buildRequest(), buildResponse()); assertEquals("", IOUtils.toString(value, Charset.defaultCharset())); }
public static BiFunction<HttpRequestBase, HttpResponse, InputStream> emptyStream() { return (request, response) -> { request.releaseConnection(); EntityUtils.consumeQuietly(response.getEntity()); return new ByteArrayInputStream(new byte[0]); }; }
Defaults { public static BiFunction<HttpRequestBase, HttpResponse, InputStream> emptyStream() { return (request, response) -> { request.releaseConnection(); EntityUtils.consumeQuietly(response.getEntity()); return new ByteArrayInputStream(new byte[0]); }; } }
Defaults { public static BiFunction<HttpRequestBase, HttpResponse, InputStream> emptyStream() { return (request, response) -> { request.releaseConnection(); EntityUtils.consumeQuietly(response.getEntity()); return new ByteArrayInputStream(new byte[0]); }; } private  Defaults(); }
Defaults { public static BiFunction<HttpRequestBase, HttpResponse, InputStream> emptyStream() { return (request, response) -> { request.releaseConnection(); EntityUtils.consumeQuietly(response.getEntity()); return new ByteArrayInputStream(new byte[0]); }; } private  Defaults(); static Function<Exception, RuntimeException> passthrough(); static BiFunction<HttpRequestBase, HttpResponse, T> asNull(); static BiFunction<HttpRequestBase, HttpResponse, String> asString(); static BiFunction<HttpRequestBase, HttpResponse, String> emptyString(); static BiFunction<HttpRequestBase, HttpResponse, InputStream> emptyStream(); static BiFunction<HttpRequestBase, HttpResponse, InputStream> pipeStream(); static BiFunction<HttpRequestBase, HttpResponse, T> convertResponse(ObjectMapper mapper,
            Class<T> clazz); static BiFunction<HttpRequestBase, HttpResponse, T> convertResponse(ObjectMapper mapper,
            TypeReference<T> typeReference); static BiFunction<HttpRequestBase, HttpResponse, T> convertResponse(ObjectMapper mapper,
            TypeReference<T> typeReference, Function<Exception, T> errorHandler); static BiFunction<HttpRequestBase, HttpResponse, JsonNode> toJson(ObjectMapper mapper); static BiFunction<HttpRequestBase, HttpResponse, S> iterate(Class<T> clazz, ObjectMapper mapper,
            Function<Iterator<T>, S> convert); static ResponseEntity<String> getResponseEntity(HttpStatus status, HttpResponse response); }
Defaults { public static BiFunction<HttpRequestBase, HttpResponse, InputStream> emptyStream() { return (request, response) -> { request.releaseConnection(); EntityUtils.consumeQuietly(response.getEntity()); return new ByteArrayInputStream(new byte[0]); }; } private  Defaults(); static Function<Exception, RuntimeException> passthrough(); static BiFunction<HttpRequestBase, HttpResponse, T> asNull(); static BiFunction<HttpRequestBase, HttpResponse, String> asString(); static BiFunction<HttpRequestBase, HttpResponse, String> emptyString(); static BiFunction<HttpRequestBase, HttpResponse, InputStream> emptyStream(); static BiFunction<HttpRequestBase, HttpResponse, InputStream> pipeStream(); static BiFunction<HttpRequestBase, HttpResponse, T> convertResponse(ObjectMapper mapper,
            Class<T> clazz); static BiFunction<HttpRequestBase, HttpResponse, T> convertResponse(ObjectMapper mapper,
            TypeReference<T> typeReference); static BiFunction<HttpRequestBase, HttpResponse, T> convertResponse(ObjectMapper mapper,
            TypeReference<T> typeReference, Function<Exception, T> errorHandler); static BiFunction<HttpRequestBase, HttpResponse, JsonNode> toJson(ObjectMapper mapper); static BiFunction<HttpRequestBase, HttpResponse, S> iterate(Class<T> clazz, ObjectMapper mapper,
            Function<Iterator<T>, S> convert); static ResponseEntity<String> getResponseEntity(HttpStatus status, HttpResponse response);  }