@Test
public void onErrorAcceptForCrashingGuardThenInvokeTheFunction() {
final Exception[] result = {null};
Guard.call(new Callable<TestClass>() {
@Override
public TestClass call() throws Exception {
throw new UnsupportedOperationException();
}
}).onError(new Consumer<Exception>() {
@Override
public void accept(@NonNull Exception e) throws Exception {
result[0] = e;
}
});
assertEquals(UnsupportedOperationException.class, result[0].getClass());
}
GuardTest.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:J-Chain
作者:
评论列表
文章目录