Add MockMethodInvocation Constructor

Issue gh-9401
This commit is contained in:
Josh Cummings 2022-08-17 22:29:36 -06:00
parent 27ce5936cf
commit 6fd23d2567
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
1 changed files with 6 additions and 1 deletions

View File

@ -38,10 +38,15 @@ public class MockMethodInvocation implements MethodInvocation {
public MockMethodInvocation(Object targetObject, Class clazz, String methodName, Class... parameterTypes)
throws NoSuchMethodException {
this.method = clazz.getMethod(methodName, parameterTypes);
this(targetObject, clazz.getMethod(methodName, parameterTypes));
this.targetObject = targetObject;
}
public MockMethodInvocation(Object targetObject, Method method) {
this.targetObject = targetObject;
this.method = method;
}
@Override
public Object[] getArguments() {
return this.arguments;