Tag java


It looks like you're looking for catchThrowableOfType, which allows you to receive the correct class:

import static org.assertj.core.api.Assertions.catchThrowableOfType;

SomeException throwable = catchThrowableOfType(() -> service.doSomething(), SomeException.class);



Reposted a post on Twitter
Post details


An ex colleague of mine wrote this pretty great article about cold start reduction for Java https://www.capitalone.com/tech/cloud/aws-lambda-java-tutorial-reduce-cold-starts/