Skip to content

Commit 6fd23d2

Browse files
committed
Add MockMethodInvocation Constructor
Issue gh-9401
1 parent 27ce593 commit 6fd23d2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/src/test/java/org/springframework/security/access/intercept/method/MockMethodInvocation.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,15 @@ public MockMethodInvocation(Object targetObject, Class clazz, String methodName,
3838

3939
public MockMethodInvocation(Object targetObject, Class clazz, String methodName, Class... parameterTypes)
4040
throws NoSuchMethodException {
41-
this.method = clazz.getMethod(methodName, parameterTypes);
41+
this(targetObject, clazz.getMethod(methodName, parameterTypes));
4242
this.targetObject = targetObject;
4343
}
4444

45+
public MockMethodInvocation(Object targetObject, Method method) {
46+
this.targetObject = targetObject;
47+
this.method = method;
48+
}
49+
4550
@Override
4651
public Object[] getArguments() {
4752
return this.arguments;

0 commit comments

Comments
 (0)