21
21
import java .util .Objects ;
22
22
23
23
import org .aopalliance .intercept .MethodInterceptor ;
24
- import org .assertj .core .api .WithAssertions ;
25
24
import org .junit .jupiter .api .BeforeEach ;
26
25
import org .junit .jupiter .api .Nested ;
27
26
import org .junit .jupiter .api .Test ;
31
30
import org .springframework .cglib .proxy .Enhancer ;
32
31
import org .springframework .lang .Nullable ;
33
32
33
+ import static org .assertj .core .api .Assertions .assertThat ;
34
+ import static org .assertj .core .api .Assertions .catchThrowable ;
34
35
import static org .mockito .BDDMockito .doAnswer ;
35
36
import static org .mockito .BDDMockito .doThrow ;
36
37
import static org .mockito .BDDMockito .mock ;
39
40
* @author Mikaël Francoeur
40
41
* @since 6.2
41
42
*/
42
- abstract class ProxyExceptionHandlingTests implements WithAssertions {
43
+ abstract class ProxyExceptionHandlingTests {
43
44
44
45
private static final RuntimeException uncheckedException = new RuntimeException ();
45
46
46
47
private static final DeclaredCheckedException declaredCheckedException = new DeclaredCheckedException ();
47
48
48
49
private static final UndeclaredCheckedException undeclaredCheckedException = new UndeclaredCheckedException ();
49
50
50
- protected final MyClass target = mock (MyClass . class );
51
+ protected final MyClass target = mock ();
51
52
52
53
protected final ProxyFactory proxyFactory = new ProxyFactory (target );
53
54
@@ -63,8 +64,7 @@ void clear() {
63
64
Mockito .clearInvocations (target );
64
65
}
65
66
66
- protected void assertProxyType (Object proxy ) {
67
- }
67
+ protected abstract void assertProxyType (Object proxy );
68
68
69
69
private void invokeProxy () {
70
70
throwableSeenByCaller = catchThrowable (() -> Objects .requireNonNull (proxy ).doSomething ());
0 commit comments