diff --git a/commons-fileupload2-jakarta-servlet5/src/test/java/org/apache/commons/fileupload2/jakarta/servlet5/JakartaServletFileUploadTest.java b/commons-fileupload2-jakarta-servlet5/src/test/java/org/apache/commons/fileupload2/jakarta/servlet5/JakartaServletFileUploadTest.java index 06b8de62a2..9e8a4910e8 100644 --- a/commons-fileupload2-jakarta-servlet5/src/test/java/org/apache/commons/fileupload2/jakarta/servlet5/JakartaServletFileUploadTest.java +++ b/commons-fileupload2-jakarta-servlet5/src/test/java/org/apache/commons/fileupload2/jakarta/servlet5/JakartaServletFileUploadTest.java @@ -21,6 +21,7 @@ import java.nio.charset.StandardCharsets; import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.fileupload2.core.AbstractFileUploadTest; import org.apache.commons.fileupload2.core.Constants; @@ -107,6 +108,14 @@ public void parseParameterMap() throws Exception { assertTrue(mappedParameters.containsKey("multi")); assertEquals(2, mappedParameters.get("multi").size()); + + final var itemCount = new AtomicInteger(); + // Replace iterator with this one to make test passed + JakartaMockServletHttpRequest request2 = new JakartaMockServletHttpRequest(bytes, Constants.CONTENT_TYPE); + upload.parseParameterMap(request); + upload.getItemIterator(request2).forEachRemaining(item -> itemCount.incrementAndGet()); + upload.getItemIterator(request).forEachRemaining(item -> itemCount.incrementAndGet()); + assertEquals(4, itemCount.get()); } @Override diff --git a/src/changes/release-notes.vm b/src/changes/release-notes.vm index 78f09cb993..937728b899 100644 --- a/src/changes/release-notes.vm +++ b/src/changes/release-notes.vm @@ -20,7 +20,7 @@ The ${developmentTeam} is pleased to announce the release of ${project.name} ${v The Apache Commons FileUpload component provides a simple yet flexible means of adding support for multipart file upload functionality to servlets and web -applications. This version requires Java 8 or later. +applications. This version requires Java 11 or above. No client code changes are required to migrate from version 1.3.0 to 1.3.1.