From 6fd23d2567a7f9dd4cbfd43142ec45bfa25dfdec Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 17 Aug 2022 22:29:36 -0600 Subject: [PATCH] Add MockMethodInvocation Constructor Issue gh-9401 --- .../access/intercept/method/MockMethodInvocation.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/test/java/org/springframework/security/access/intercept/method/MockMethodInvocation.java b/core/src/test/java/org/springframework/security/access/intercept/method/MockMethodInvocation.java index f0e8c4b2de..a2b181e301 100644 --- a/core/src/test/java/org/springframework/security/access/intercept/method/MockMethodInvocation.java +++ b/core/src/test/java/org/springframework/security/access/intercept/method/MockMethodInvocation.java @@ -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;