This is an automated email from the ASF dual-hosted git repository.

kusal pushed a commit to branch WW-5350-allowlist
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 39787947f181550e9f96f562df9494f1932abcc6
Author: Kusal Kithul-Godage <g...@kusal.io>
AuthorDate: Sun Nov 5 19:49:25 2023 +1100

    WW-5350 Fix static member test
---
 .../opensymphony/xwork2/interceptor/ParametersInterceptorTest.java  | 2 +-
 .../java/com/opensymphony/xwork2/ognl/SecurityMemberAccessTest.java | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java
 
b/core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java
index 2e7a0be16..f1d1fe9f0 100644
--- 
a/core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java
+++ 
b/core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java
@@ -350,7 +350,7 @@ public class ParametersInterceptorTest extends 
XWorkTestCase {
         //then
         assertEquals("This is blah", ((SimpleAction) 
proxy.getAction()).getBlah());
         Field field = 
ReflectionContextState.class.getField("DENY_METHOD_EXECUTION");
-        boolean allowStaticFieldAccess = ((OgnlContext) 
stack.getContext()).getMemberAccess().isAccessible(stack.getContext(), 
proxy.getAction(), field, "");
+        boolean allowStaticFieldAccess = ((OgnlContext) 
stack.getContext()).getMemberAccess().isAccessible(stack.getContext(), 
ReflectionContextState.class, field, "");
         assertFalse(allowStaticFieldAccess);
     }
 
diff --git 
a/core/src/test/java/com/opensymphony/xwork2/ognl/SecurityMemberAccessTest.java 
b/core/src/test/java/com/opensymphony/xwork2/ognl/SecurityMemberAccessTest.java
index 830cdbb2c..7ffc47b9f 100644
--- 
a/core/src/test/java/com/opensymphony/xwork2/ognl/SecurityMemberAccessTest.java
+++ 
b/core/src/test/java/com/opensymphony/xwork2/ognl/SecurityMemberAccessTest.java
@@ -368,7 +368,7 @@ public class SecurityMemberAccessTest {
 
         // when
         Member method = StaticTester.class.getMethod("sayHello");
-        boolean actual = sma.isAccessible(context, Class.class, method, null);
+        boolean actual = sma.isAccessible(context, StaticTester.class, method, 
null);
 
         // then
         assertFalse("Access to static method is not blocked!", actual);
@@ -595,7 +595,7 @@ public class SecurityMemberAccessTest {
 
         // when
         Member method = StaticTester.class.getMethod("sayHello");
-        boolean actual = sma.isAccessible(context, Class.class, method, null);
+        boolean actual = sma.isAccessible(context, StaticTester.class, method, 
null);
 
         // then
         assertFalse("Access to static isn't blocked!", actual);
@@ -704,7 +704,7 @@ public class SecurityMemberAccessTest {
         member = System.class.getMethod(propertyName, int.class);
 
         // when
-        accessible = sma.isAccessible(context, target, member, propertyName);
+        accessible = sma.isAccessible(context, System.class, member, 
propertyName);
 
         // then
         assertFalse(accessible);

Reply via email to