2121import java .util .Objects ;
2222
2323import org .aopalliance .intercept .MethodInterceptor ;
24- import org .assertj .core .api .WithAssertions ;
2524import org .junit .jupiter .api .BeforeEach ;
2625import org .junit .jupiter .api .Nested ;
2726import org .junit .jupiter .api .Test ;
3130import org .springframework .cglib .proxy .Enhancer ;
3231import org .springframework .lang .Nullable ;
3332
33+ import static org .assertj .core .api .Assertions .assertThat ;
34+ import static org .assertj .core .api .Assertions .catchThrowable ;
3435import static org .mockito .BDDMockito .doAnswer ;
3536import static org .mockito .BDDMockito .doThrow ;
3637import static org .mockito .BDDMockito .mock ;
3940 * @author Mikaël Francoeur
4041 * @since 6.2
4142 */
42- abstract class ProxyExceptionHandlingTests implements WithAssertions {
43+ abstract class ProxyExceptionHandlingTests {
4344
4445 private static final RuntimeException uncheckedException = new RuntimeException ();
4546
4647 private static final DeclaredCheckedException declaredCheckedException = new DeclaredCheckedException ();
4748
4849 private static final UndeclaredCheckedException undeclaredCheckedException = new UndeclaredCheckedException ();
4950
50- protected final MyClass target = mock (MyClass . class );
51+ protected final MyClass target = mock ();
5152
5253 protected final ProxyFactory proxyFactory = new ProxyFactory (target );
5354
@@ -63,8 +64,7 @@ void clear() {
6364 Mockito .clearInvocations (target );
6465 }
6566
66- protected void assertProxyType (Object proxy ) {
67- }
67+ protected abstract void assertProxyType (Object proxy );
6868
6969 private void invokeProxy () {
7070 throwableSeenByCaller = catchThrowable (() -> Objects .requireNonNull (proxy ).doSomething ());
0 commit comments