You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by GitBox <gi...@apache.org> on 2021/09/30 10:36:29 UTC

[GitHub] [struts] yasserzamani commented on a change in pull request #499: [WW-5143] [WW-5142] Upgrades OVal to ver. 3.2.1 and upgrades XStream to ver 1.4.18

yasserzamani commented on a change in pull request #499:
URL: https://github.com/apache/struts/pull/499#discussion_r719277944



##########
File path: plugins/oval/src/test/java/org/apache/struts2/oval/interceptor/OValValidationInterceptorTest.java
##########
@@ -308,24 +296,12 @@ public void testMemberObject() throws Exception {
 
         Map<String, List<String>> fieldErrors = ((ValidationAware) baseActionProxy.getAction()).getFieldErrors();
         assertNotNull(fieldErrors);
-        assertEquals(5, fieldErrors.size()); // 5: as there will be field errors for 'person' and 'person.address' themselves
-        assertValue(fieldErrors, "person.name", Arrays.asList("name cannot be null"));
-        assertValue(fieldErrors, "person.email", Arrays.asList("email cannot be null"));
-        try {
-            // Oval version <= 1.40 validation error for invalid data reports: "net.sf.oval.constraint.AssertValid.violated".
-            assertValue(fieldErrors, "person.address", Arrays.asList("net.sf.oval.constraint.AssertValid.violated"));
-            // Oval version <= 1.40 validation error for minimum length reports: "street cannot be smaller than 7 characters".
-            assertValue(fieldErrors, "person.address.street", Arrays.asList("street cannot be smaller than 7 characters"));
-        } catch (AssertionFailedError afe) {
-            // Oval version >= 1.50 validation error for invalid data reports: "address is invalid".
-            assertValue(fieldErrors, "person.address", Arrays.asList("address is invalid"));
-            // Oval version >= 1.50 validation error for minimum length reports: "street cannot be shorter than 7 characters".
-            assertValue(fieldErrors, "person.address.street", Arrays.asList("street cannot be shorter than 7 characters"));
-        }
-
+        assertEquals(3, fieldErrors.size()); // 5: as there will be field errors for 'person' and 'person.address' themselves

Review comment:
       nitpick: // 5: in comment should be // 3:

##########
File path: plugins/oval/src/test/java/org/apache/struts2/oval/interceptor/OValValidationInterceptorTest.java
##########
@@ -281,21 +280,10 @@ public void testModelDrivenAction() throws Exception {
 
         Map<String, List<String>> fieldErrors = ((ValidationAware) baseActionProxy.getAction()).getFieldErrors();
         assertNotNull(fieldErrors);
-        assertEquals(5, fieldErrors.size()); // 5: as there will be field errors for 'model' and 'address' themselves
-        assertValue(fieldErrors, "name", Arrays.asList("name cannot be null"));
-        assertValue(fieldErrors, "email", Arrays.asList("email cannot be null"));
-        try {
-            // Oval version <= 1.40 validation error for invalid data reports: "net.sf.oval.constraint.AssertValid.violated".
-            assertValue(fieldErrors, "address", Arrays.asList("net.sf.oval.constraint.AssertValid.violated"));
-            // Oval version <= 1.40 validation error for minimum length reports: "street cannot be smaller than 7 characters".
-            assertValue(fieldErrors, "address.street", Arrays.asList("street cannot be smaller than 7 characters"));
-        } catch (AssertionFailedError afe) {
-            // Oval version >= 1.50 validation error for invalid data reports: "address is invalid".
-            assertValue(fieldErrors, "address", Arrays.asList("address is invalid"));
-            // Oval version >= 1.50 validation error for minimum length reports: "street cannot be shorter than 7 characters".
-            assertValue(fieldErrors, "address.street", Arrays.asList("street cannot be shorter than 7 characters"));
-        }
-
+        assertEquals(3, fieldErrors.size()); // 5: as there will be field errors for 'model' and 'address' themselves

Review comment:
       nitpick: // 5: in comment should be // 3:




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org