Tag java

 Reply

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);

assertThat(throwable.getSomething()).isNotNull();

 Repost

Reposted a post on Twitter
Post details

 Reply

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/