lukaszlenart commented on code in PR #1262:
URL: https://github.com/apache/struts/pull/1262#discussion_r2075154964
##########
core/src/test/java/org/apache/struts2/interceptor/ActionFileUploadInterceptorTest.java:
##########
@@ -205,6 +252,22 @@ public void testAcceptFileWithNoFile() {
assertTrue(msg.indexOf("inputName") > 0);
}
+ public void testAcceptFileWithNoContent() {
+ interceptor.setAllowedTypes("text/plain");
+
+ ValidationAwareSupport validation = new ValidationAwareSupport();
+ boolean notOk = interceptor.acceptFile(validation, NULL_CONTENT,
"filename.html", "text/plain", "inputName");
+
+ assertFalse(notOk);
+ assertFalse(validation.getFieldErrors().isEmpty());
+ assertTrue(validation.hasErrors());
+ List<String> errors = validation.getFieldErrors().get("inputName");
Review Comment:
I want to make this change as small as possible, I will do a large
refactoring once cherry-picking changes into Struts 7
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]