test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java
changeset 49765 ee6f7a61f3a5
parent 48083 b1c1b4ef4be2
child 56451 9585061fdb04
child 57685 e4cc5231ce2d
--- a/test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java	Tue Apr 17 15:39:20 2018 +0200
+++ b/test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java	Tue Apr 17 08:54:17 2018 -0700
@@ -21,12 +21,12 @@
  * questions.
  */
 
-import jdk.incubator.http.HttpResponse;
-import jdk.incubator.http.HttpResponse.BodySubscriber;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UncheckedIOException;
+import java.net.http.HttpResponse;
+import java.net.http.HttpResponse.BodySubscriber;
+import java.net.http.HttpResponse.BodySubscribers;
 import java.nio.ByteBuffer;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
@@ -63,7 +63,7 @@
     @Test
     public static void testOnError() throws InterruptedException, ExecutionException {
         CountDownLatch latch = new CountDownLatch(1);
-        BodySubscriber<InputStream> isb = BodySubscriber.asInputStream();
+        BodySubscriber<InputStream> isb = BodySubscribers.ofInputStream();
         ErrorTestSubscription s = new ErrorTestSubscription(isb);
         CompletionStage<Throwable> cs =
                 isb.getBody().thenApplyAsync((is) -> s.accept(latch, is));
@@ -158,7 +158,7 @@
     public static void testCloseAndSubscribe()
             throws InterruptedException, ExecutionException
     {
-        BodySubscriber<InputStream> isb = BodySubscriber.asInputStream();
+        BodySubscriber<InputStream> isb = BodySubscribers.ofInputStream();
         TestCancelOnCloseSubscription s = new TestCancelOnCloseSubscription();
         InputStream is = isb.getBody()
                 .thenApply(HttpResponseInputStreamTest::close)
@@ -187,7 +187,7 @@
     public static void testSubscribeAndClose()
             throws InterruptedException, ExecutionException
     {
-        BodySubscriber<InputStream> isb = BodySubscriber.asInputStream();
+        BodySubscriber<InputStream> isb = BodySubscribers.ofInputStream();
         TestCancelOnCloseSubscription s = new TestCancelOnCloseSubscription();
         InputStream is = isb.getBody().toCompletableFuture().get();
         isb.onSubscribe(s);