This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch fix/WW-5250-todo
in repository https://gitbox.apache.org/repos/asf/struts.git
commit 03db4f1ab06c200b0478b069214d7579a08a3ef0
Author: Lukasz Lenart
AuthorDate: Fri Jun 7 08:33:08 2024 +0200
WW-5250 Addresses TODO in test and stops using Mock Objects
---
.../xwork2/validator/ActionValidatorManager.java | 4 +-
.../validator/DefaultActionValidatorManager.java | 18 +-
.../DefaultActionValidatorManagerTest.java | 358 ++---
3 files changed, 187 insertions(+), 193 deletions(-)
diff --git
a/core/src/main/java/com/opensymphony/xwork2/validator/ActionValidatorManager.java
b/core/src/main/java/com/opensymphony/xwork2/validator/ActionValidatorManager.java
index d78224b26..ea0de3a72 100644
---
a/core/src/main/java/com/opensymphony/xwork2/validator/ActionValidatorManager.java
+++
b/core/src/main/java/com/opensymphony/xwork2/validator/ActionValidatorManager.java
@@ -36,7 +36,7 @@ public interface ActionValidatorManager {
* @param method the name of the method being invoked on the action - can
be null.
* @return a list of all validators for the given class and context.
*/
-List getValidators(Class clazz, String context, String method);
+List getValidators(Class clazz, String context, String
method);
/**
* Returns a list of validators for the given class and context. This is
the primary
@@ -46,7 +46,7 @@ public interface ActionValidatorManager {
* @param context the context of the action class - can be null.
* @return a list of all validators for the given class and context.
*/
-List getValidators(Class clazz, String context);
+List getValidators(Class clazz, String context);
/**
* Validates the given object using action and its context.
diff --git
a/core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
b/core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
index 3af54669e..f05b80486 100644
---
a/core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
+++
b/core/src/main/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManager.java
@@ -125,7 +125,7 @@ public class DefaultActionValidatorManager implements
ActionValidatorManager {
* @param context context
* @return a validator key which is the class name plus context.
*/
-protected String buildValidatorKey(Class clazz, String context) {
+protected String buildValidatorKey(Class clazz, String context) {
return clazz.getName() + "/" + context;
}
@@ -137,7 +137,7 @@ public class DefaultActionValidatorManager implements
ActionValidatorManager {
}
@Override
-public synchronized List getValidators(Class clazz, String
context, String method) {
+public synchronized List getValidators(Class clazz, String
context, String method) {
String validatorKey = buildValidatorKey(clazz, context);
if (!validatorCache.containsKey(validatorKey)) {
@@ -158,7 +158,7 @@ public class DefaultActionValidatorManager implements
ActionValidatorManager {
}
@Override
-public synchronized List getValidators(Class clazz, String
context) {
+public synchronized List getValidators(Class clazz, String
context) {
return getValidators(clazz, context, null);
}
@@ -277,7 +277,7 @@ public class DefaultActionValidatorManager implements
ActionValidatorManager {
* @param checked the set of previously checked class-contexts, null if
none have been checked
* @return a list of validator configs for the given class and context.
*/
-protected List buildValidatorConfigs(Class clazz, String
context, boolean checkFile, Set checked) {
+protected List buildValidatorConfigs(Class clazz,
String context, boolean checkFile, Set checked) {
List validatorConfigs = new ArrayList<>();
if (checked == null) {
@@ -287,7 +287,7 @@ public class DefaultActionValidatorManager implements
ActionValidatorManager {
}
if (clazz.isInterface()) {
-for (Class anInterface : clazz.getInterfaces()) {
+for (Class anInterface : clazz.getInterfaces()) {
validatorConfigs.addAll(buildValidatorConfigs(anInterface,
context, checkFile, checked));
}
} else {
@@ -297,7 +297,7 @@ public class DefaultActionValidatorManager implements
ActionValidatorManager {
}
// look for validators for implemented interfaces
-for (Class anInterface1 : clazz.getInterfaces()) {
+for (Class anInterface1 : clazz.getInterfaces()) {
if (checked.contains(anInterface1.getName())) {
continue;
}
@@ -317,17 +317,17 @@ public class DefaultActionValidatorManager implements
ActionValidatorManager {
return