Skip to content

Commit 3e0e5c1

Browse files
Avoid use deprecated code (#768)
1 parent 297624e commit 3e0e5c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

httpclient5-sse/src/test/java/org/apache/hc/client5/http/sse/DefaultEventSourceIntegrationTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import java.util.concurrent.TimeUnit;
4141

4242
import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
43+
import org.apache.hc.client5.http.protocol.HttpClientContext;
4344
import org.apache.hc.client5.http.sse.impl.SseParser;
4445
import org.apache.hc.core5.concurrent.FutureCallback;
4546
import org.apache.hc.core5.function.Supplier;
@@ -51,7 +52,6 @@
5152
import org.apache.hc.core5.http.nio.AsyncRequestProducer;
5253
import org.apache.hc.core5.http.nio.AsyncResponseConsumer;
5354
import org.apache.hc.core5.http.nio.HandlerFactory;
54-
import org.apache.hc.core5.http.protocol.BasicHttpContext;
5555
import org.apache.hc.core5.http.protocol.HttpContext;
5656
import org.apache.hc.core5.io.CloseMode;
5757
import org.apache.hc.core5.reactor.IOReactorStatus;
@@ -102,10 +102,11 @@ public void onClosed() {
102102
final AsyncResponseConsumer<Void> c = fake.lastConsumer;
103103
assertNotNull(c, "consumer captured");
104104

105+
final HttpContext context = HttpClientContext.create();
105106
c.consumeResponse(
106107
new BasicHttpResponse(HttpStatus.SC_OK, "OK"),
107108
new TestEntityDetails("text/event-stream"),
108-
new BasicHttpContext(), // FIX: concrete HttpContext
109+
context,
109110
new FutureCallback<Void>() {
110111
@Override
111112
public void completed(final Void result) {

0 commit comments

Comments
 (0)