diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-12-09 16:25:27 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-12-10 10:28:28 +0100 |
commit | 134af4f00cb0302f1ba465e51973fe44e1646e19 (patch) | |
tree | 5724df56111808aca6c33161e6f2d6740be0f8dd /jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java | |
parent | 4bc0e6916d4532f00b735a79905e40f3b8eb51ea (diff) |
Remove use of Guava ListenableFuture from com.yahoo.jdisc.handler
This change is not 100% API compatible. Many classes from this package inherited types from Guava.
The classes will have the same methods as before, but their type has obviously changed.
Two options; merge now with the small risk of breakage or wait for Vespa 8 branch.
Diffstat (limited to 'jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java')
-rw-r--r-- | jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java b/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java index f9a5c22837f..4006ab072cb 100644 --- a/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java +++ b/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ResponseDispatchTestCase.java @@ -1,7 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.jdisc.handler; -import com.google.common.util.concurrent.MoreExecutors; import com.yahoo.jdisc.Response; import org.junit.Test; @@ -14,13 +13,13 @@ import java.util.List; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * @author Simon Thoresen Hult @@ -179,7 +178,7 @@ public class ResponseDispatchTestCase { ReadableContentChannel responseContent = new ReadableContentChannel(); ResponseDispatch.newInstance(6, ByteBuffer.allocate(9)) .dispatch(new MyResponseHandler(responseContent)) - .addListener(listener, MoreExecutors.directExecutor()); + .whenComplete((__, ___) -> listener.run()); assertFalse(listener.await(100, TimeUnit.MILLISECONDS)); assertNotNull(responseContent.read()); assertFalse(listener.await(100, TimeUnit.MILLISECONDS)); |