@@ -62,7 +62,7 @@ public static void testMultipleMethods(final @NotNull Object executor, final @No
62
62
}
63
63
64
64
/**
65
- * Allows to test the given <i>targetMethod</i>.
65
+ * Allows testing the given <i>targetMethod</i>.
66
66
* It verifies that the <i>executor</i> invokes <i>targetMethod</i> and that,
67
67
* upon execution, <i>target</i> invokes <i>invokedMethod</i>.
68
68
*
@@ -86,13 +86,16 @@ public static void testMultipleMethods(final @NotNull Object executor, final @No
86
86
ReflectionUtils .setAccessible (targetMethod ).invoke (executor , parameters );
87
87
88
88
// Verify execution with mock
89
- new Refl <>(verify (target )).invokeMethod (invokedMethod , invokedMethodParamTypes ,
89
+ Method method = target .getClass ().getDeclaredMethod (invokedMethod , invokedMethodParamTypes );
90
+ ReflectionUtils .setAccessible (method ).invoke (verify (target ),
90
91
Arrays .stream (captors ).map (ArgumentCaptor ::capture ).toArray (Object []::new ));
91
92
92
93
return captors ;
93
94
} catch (Exception e ) {
94
95
System .err .printf ("An exception occurred while testing method '%s'%n" , methodToString (targetMethod ));
95
96
System .err .printf ("target: '%s'%n" , target .getClass ().getCanonicalName ());
97
+ System .err .printf ("method: '%s'%n" , ReflectionUtils .getMethod (target .getClass (), null , invokedMethod ,
98
+ invokedMethodParamTypes ));
96
99
System .err .printf ("Invoked method parameter types: '%s'%n" , Arrays .toString (invokedMethodParamTypes ));
97
100
System .err .printf ("Captors: '%s'%n" , Arrays .toString (captors ));
98
101
ExceptionUtils .throwException (e );
0 commit comments