From f728036b3c2ed598621f6f68ebb68aa540352c19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 04:21:38 +0000 Subject: [PATCH 1/2] Bump org.apache.httpcomponents.client5:httpclient5 from 5.3.1 to 5.4.1 Bumps [org.apache.httpcomponents.client5:httpclient5](https://github.com/apache/httpcomponents-client) from 5.3.1 to 5.4.1. - [Changelog](https://github.com/apache/httpcomponents-client/blob/rel/v5.4.1/RELEASE_NOTES.txt) - [Commits](https://github.com/apache/httpcomponents-client/compare/rel/v5.3.1...rel/v5.4.1) --- updated-dependencies: - dependency-name: org.apache.httpcomponents.client5:httpclient5 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- logbook-httpclient5/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logbook-httpclient5/pom.xml b/logbook-httpclient5/pom.xml index 219698764..0e06b3c6d 100644 --- a/logbook-httpclient5/pom.xml +++ b/logbook-httpclient5/pom.xml @@ -22,7 +22,7 @@ org.apache.httpcomponents.client5 httpclient5 - 5.3.1 + 5.4.1 From 46d93ef9771b79aaae6a9d20f5b0a84d39644a56 Mon Sep 17 00:00:00 2001 From: Karen Asmarian Date: Tue, 29 Oct 2024 13:42:37 +0100 Subject: [PATCH 2/2] pass the context to client.execute() call in test In https://github.com/apache/httpcomponents-client/commit/762b18fe6939245443f95e88824e229d4ad0294c#diff-211fca6aa691ca5414d407b6c70c9b02e75873835bc84f00a96b21af0f86fb4fR321 the empty context creation was removed from the execute() method leading to NPEs in tests. --- .../httpclient5/LogbookHttpAsyncResponseConsumerTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/logbook-httpclient5/src/test/java/org/zalando/logbook/httpclient5/LogbookHttpAsyncResponseConsumerTest.java b/logbook-httpclient5/src/test/java/org/zalando/logbook/httpclient5/LogbookHttpAsyncResponseConsumerTest.java index bb6ba8df3..f21d642b4 100644 --- a/logbook-httpclient5/src/test/java/org/zalando/logbook/httpclient5/LogbookHttpAsyncResponseConsumerTest.java +++ b/logbook-httpclient5/src/test/java/org/zalando/logbook/httpclient5/LogbookHttpAsyncResponseConsumerTest.java @@ -6,6 +6,7 @@ import org.apache.hc.client5.http.async.methods.SimpleResponseConsumer; import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient; import org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder; +import org.apache.hc.client5.http.protocol.HttpClientContext; import org.apache.hc.core5.concurrent.FutureCallback; import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.HttpHeaders; @@ -55,7 +56,7 @@ protected ClassicHttpResponse sendAndReceive(@Nullable final String body) throws AtomicReference responseRef = new AtomicReference<>(null); CountDownLatch latch = new CountDownLatch(1); - HttpResponse response = client.execute(SimpleRequestProducer.create(builder.build()), new LogbookHttpAsyncResponseConsumer<>(SimpleResponseConsumer.create()), getCallback(responseRef, latch)).get(); + HttpResponse response = client.execute(SimpleRequestProducer.create(builder.build()), new LogbookHttpAsyncResponseConsumer<>(SimpleResponseConsumer.create()), HttpClientContext.create(), getCallback(responseRef, latch)).get(); BasicClassicHttpResponse httpResponse = new BasicClassicHttpResponse(response.getCode(), response.getReasonPhrase()); latch.await(5, SECONDS);