mirror of https://github.com/apache/druid.git
Adds an additional test case to FutureUtilsTest. Co-authored-by: Gian Merlino <gianmerlino@gmail.com>
This commit is contained in:
parent
f4ad5d001b
commit
25f2447fb2
|
@ -243,6 +243,32 @@ public class FutureUtilsTest
|
|||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_transformAsync_exceptionInFunction()
|
||||
{
|
||||
final ListenableFuture<Object> f = FutureUtils.transformAsync(
|
||||
Futures.immediateFuture("x"),
|
||||
s -> {
|
||||
throw new ISE("error!");
|
||||
}
|
||||
);
|
||||
|
||||
final ExecutionException e = Assert.assertThrows(
|
||||
ExecutionException.class,
|
||||
f::get
|
||||
);
|
||||
|
||||
MatcherAssert.assertThat(
|
||||
e,
|
||||
ThrowableCauseMatcher.hasCause(CoreMatchers.instanceOf(ISE.class))
|
||||
);
|
||||
|
||||
MatcherAssert.assertThat(
|
||||
e,
|
||||
ThrowableCauseMatcher.hasCause(ThrowableMessageMatcher.hasMessage(CoreMatchers.containsString("error!")))
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_coalesce_allOk() throws Exception
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue