diff options
author | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2024-01-02 18:15:48 +0000 |
---|---|---|
committer | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2024-01-02 18:23:02 +0000 |
commit | 1b60467f3624ad6bae92bb65652a10c49639023e (patch) | |
tree | cbc7e4894708533a0ddc4e61da1d74e64393e0e1 /guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java | |
parent | eec82bd5ace8fd2c4ba647f153c4c03e1bb41268 (diff) | |
parent | d258d3ed3336934354f340518065b04528fb1f2b (diff) | |
download | guava-1b60467f3624ad6bae92bb65652a10c49639023e.tar.gz |
Upgrade guava to v33.0.0
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update guava
For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md
Test: TreeHugger
Change-Id: I9a54a36317484a947b630a037e23c9919c2951cd
Diffstat (limited to 'guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java')
-rw-r--r-- | guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java index ab53f5383..48d5c8e5a 100644 --- a/guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java @@ -23,6 +23,7 @@ import static com.google.common.util.concurrent.Futures.immediateFuture; import static com.google.common.util.concurrent.MoreExecutors.directExecutor; import static java.util.concurrent.Executors.newScheduledThreadPool; import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.Assert.assertThrows; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; @@ -138,12 +139,8 @@ public class FluentFutureTest extends TestCase { try { FluentFuture<?> f = FluentFuture.from(SettableFuture.create()).withTimeout(0, SECONDS, executor); - try { - f.get(); - fail(); - } catch (ExecutionException e) { - assertThat(e).hasCauseThat().isInstanceOf(TimeoutException.class); - } + ExecutionException e = assertThrows(ExecutionException.class, () -> f.get()); + assertThat(e).hasCauseThat().isInstanceOf(TimeoutException.class); } finally { executor.shutdown(); } |