Migrate away from AssertJ's catchThrowable()

Closes gh-35003
This commit is contained in:
Sam Brannen
2025-06-06 15:01:26 +02:00
parent 3aa3b81e1c
commit ad2931b51f
3 changed files with 41 additions and 41 deletions

View File

@@ -29,7 +29,6 @@ import org.mockito.Mockito;
import org.mockito.stubbing.Answer;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.catchThrowable;
import static org.mockito.BDDMockito.willAnswer;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Mockito.mock;
@@ -69,7 +68,12 @@ abstract class AbstractProxyExceptionHandlingTests {
private void invokeProxy() {
throwableSeenByCaller = catchThrowable(() -> Objects.requireNonNull(proxy).doSomething());
try {
Objects.requireNonNull(proxy).doSomething();
}
catch (Throwable throwable) {
throwableSeenByCaller = throwable;
}
}
@SuppressWarnings("SameParameterValue")