@Test public void canFreezeTimeForTests() { Instant i = Instant.now(); Util.freezeClock(i); TestRequest r1 = new TestRequest(); TestRequest r2 = new TestRequest(); assertEquals(r1.getCreationTime(), r2.getCreationTime()); Util.freezeClock(i.plus(50, ChronoUnit.MINUTES)); TestRequest r3 = new TestRequest(); assertEquals(50L, ChronoUnit.MINUTES.between(r1.getCreationTime(), r3.getCreationTime())); }
@Override public Instant getCreationTime() { return creation; }
BaseRequest implements HttpRequest<R> { @Override public Instant getCreationTime() { return creation; } }
BaseRequest implements HttpRequest<R> { @Override public Instant getCreationTime() { return creation; } BaseRequest(BaseRequest httpRequest);   BaseRequest(Config config, HttpMethod method, String url); }
BaseRequest implements HttpRequest<R> { @Override public Instant getCreationTime() { return creation; } BaseRequest(BaseRequest httpRequest);   BaseRequest(Config config, HttpMethod method, String url); @Override R routeParam(String name, String value); @Override R routeParam(Map<String, Object> params); @Override R basicAuth(String username, String password); @Override R accept(String value); @Override R responseEncoding(String encoding); @Override R header(String name, String value); @Override R headerReplace(String name, String value); @Override R headers(Map<String, String> headerMap); @Override R cookie(String name, String value); @Override R cookie(Cookie cookie); @Override R cookie(Collection<Cookie> cookies); @Override R queryString(String name, Collection<?> value); @Override R queryString(String name, Object value); @Override R queryString(Map<String, Object> parameters); @Override R socketTimeout(int millies); @Override R connectTimeout(int millies); @Override R proxy(String host, int port); @Override R withObjectMapper(ObjectMapper mapper); @Override R downloadMonitor(ProgressMonitor monitor); @Override HttpResponse asEmpty(); @Override CompletableFuture<HttpResponse<Empty>> asEmptyAsync(); @Override CompletableFuture<HttpResponse<Empty>> asEmptyAsync(Callback<Empty> callback); @Override HttpResponse<String> asString(); @Override CompletableFuture<HttpResponse<String>> asStringAsync(); @Override CompletableFuture<HttpResponse<String>> asStringAsync(Callback<String> callback); @Override HttpResponse<byte[]> asBytes(); @Override CompletableFuture<HttpResponse<byte[]>> asBytesAsync(); @Override CompletableFuture<HttpResponse<byte[]>> asBytesAsync(Callback<byte[]> callback); @Override HttpResponse<JsonNode> asJson(); @Override CompletableFuture<HttpResponse<JsonNode>> asJsonAsync(); @Override CompletableFuture<HttpResponse<JsonNode>> asJsonAsync(Callback<JsonNode> callback); @Override HttpResponse<T> asObject(Class<? extends T> responseClass); @Override HttpResponse<T> asObject(GenericType<T> genericType); @Override HttpResponse<T> asObject(Function<RawResponse, T> function); @Override CompletableFuture<HttpResponse<T>> asObjectAsync(Function<RawResponse, T> function); @Override CompletableFuture<HttpResponse<T>> asObjectAsync(Class<? extends T> responseClass); @Override CompletableFuture<HttpResponse<T>> asObjectAsync(Class<? extends T> responseClass, Callback<T> callback); @Override CompletableFuture<HttpResponse<T>> asObjectAsync(GenericType<T> genericType); @Override CompletableFuture<HttpResponse<T>> asObjectAsync(GenericType<T> genericType, Callback<T> callback); @Override void thenConsume(Consumer<RawResponse> consumer); @Override void thenConsumeAsync(Consumer<RawResponse> consumer); @Override HttpResponse<File> asFile(String path, CopyOption... copyOptions); @Override CompletableFuture<HttpResponse<File>> asFileAsync(String path, CopyOption... copyOptions); @Override CompletableFuture<HttpResponse<File>> asFileAsync(String path, Callback<File> callback, CopyOption... copyOptions); @Override PagedList<T> asPaged(Function<HttpRequest, HttpResponse> mappingFunction, Function<HttpResponse<T>, String> linkExtractor); @Override HttpMethod getHttpMethod(); @Override String getUrl(); @Override Headers getHeaders(); @Override int getSocketTimeout(); @Override int getConnectTimeout(); @Override Proxy getProxy(); @Override HttpRequestSummary toSummary(); @Override Instant getCreationTime(); @Override boolean equals(Object o); @Override int hashCode(); }
BaseRequest implements HttpRequest<R> { @Override public Instant getCreationTime() { return creation; } BaseRequest(BaseRequest httpRequest);   BaseRequest(Config config, HttpMethod method, String url); @Override R routeParam(String name, String value); @Override R routeParam(Map<String, Object> params); @Override R basicAuth(String username, String password); @Override R accept(String value); @Override R responseEncoding(String encoding); @Override R header(String name, String value); @Override R headerReplace(String name, String value); @Override R headers(Map<String, String> headerMap); @Override R cookie(String name, String value); @Override R cookie(Cookie cookie); @Override R cookie(Collection<Cookie> cookies); @Override R queryString(String name, Collection<?> value); @Override R queryString(String name, Object value); @Override R queryString(Map<String, Object> parameters); @Override R socketTimeout(int millies); @Override R connectTimeout(int millies); @Override R proxy(String host, int port); @Override R withObjectMapper(ObjectMapper mapper); @Override R downloadMonitor(ProgressMonitor monitor); @Override HttpResponse asEmpty(); @Override CompletableFuture<HttpResponse<Empty>> asEmptyAsync(); @Override CompletableFuture<HttpResponse<Empty>> asEmptyAsync(Callback<Empty> callback); @Override HttpResponse<String> asString(); @Override CompletableFuture<HttpResponse<String>> asStringAsync(); @Override CompletableFuture<HttpResponse<String>> asStringAsync(Callback<String> callback); @Override HttpResponse<byte[]> asBytes(); @Override CompletableFuture<HttpResponse<byte[]>> asBytesAsync(); @Override CompletableFuture<HttpResponse<byte[]>> asBytesAsync(Callback<byte[]> callback); @Override HttpResponse<JsonNode> asJson(); @Override CompletableFuture<HttpResponse<JsonNode>> asJsonAsync(); @Override CompletableFuture<HttpResponse<JsonNode>> asJsonAsync(Callback<JsonNode> callback); @Override HttpResponse<T> asObject(Class<? extends T> responseClass); @Override HttpResponse<T> asObject(GenericType<T> genericType); @Override HttpResponse<T> asObject(Function<RawResponse, T> function); @Override CompletableFuture<HttpResponse<T>> asObjectAsync(Function<RawResponse, T> function); @Override CompletableFuture<HttpResponse<T>> asObjectAsync(Class<? extends T> responseClass); @Override CompletableFuture<HttpResponse<T>> asObjectAsync(Class<? extends T> responseClass, Callback<T> callback); @Override CompletableFuture<HttpResponse<T>> asObjectAsync(GenericType<T> genericType); @Override CompletableFuture<HttpResponse<T>> asObjectAsync(GenericType<T> genericType, Callback<T> callback); @Override void thenConsume(Consumer<RawResponse> consumer); @Override void thenConsumeAsync(Consumer<RawResponse> consumer); @Override HttpResponse<File> asFile(String path, CopyOption... copyOptions); @Override CompletableFuture<HttpResponse<File>> asFileAsync(String path, CopyOption... copyOptions); @Override CompletableFuture<HttpResponse<File>> asFileAsync(String path, Callback<File> callback, CopyOption... copyOptions); @Override PagedList<T> asPaged(Function<HttpRequest, HttpResponse> mappingFunction, Function<HttpResponse<T>, String> linkExtractor); @Override HttpMethod getHttpMethod(); @Override String getUrl(); @Override Headers getHeaders(); @Override int getSocketTimeout(); @Override int getConnectTimeout(); @Override Proxy getProxy(); @Override HttpRequestSummary toSummary(); @Override Instant getCreationTime(); @Override boolean equals(Object o); @Override int hashCode();  }