소스 검색

Add MockMethodInvocation Constructor

Issue gh-9401
Josh Cummings 3 년 전
부모
커밋
6fd23d2567
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      core/src/test/java/org/springframework/security/access/intercept/method/MockMethodInvocation.java

+ 6 - 1
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;