In my example, I defined a runtime exception TimeoutAspectException, user can
know that a timeout has occurred when catching the exception
The following unit test case tested a custom exception TimeoutAspectException
@Test(expected = TimeoutAspectException.class)
public void timeoutCatchTimeoutAspectExceptionTest() throws
TimeoutAspectException {
List<User> users = new ArrayList<>();
users.add(User.builder().id(1).name("zhanglei").build());
myService.save(users, 3000);
}
Lei Zhang
> 在 2019年4月24日,下午10:16,Willem Jiang <[email protected]> 写道:
>
> As the calling thread is change, we need to tell the user about it.