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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-fileupload.git

commit 428192078ed8eca296a7dbaf7a50a83d931ea9fb
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Apr 2 11:53:01 2023 -0400

    Reuse Apache Commons Lang for testing
---
 pom.xml                                                          | 6 ++++++
 .../apache/commons/fileupload2/DiskFileItemSerializeTest.java    | 9 ++-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index c6e74ca..1e74afd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -277,6 +277,12 @@
        <version>5.0.0</version>
        <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <version>3.12.0</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
diff --git 
a/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java 
b/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java
index e04c7ec..8d913c7 100644
--- 
a/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java
+++ 
b/src/test/java/org/apache/commons/fileupload2/DiskFileItemSerializeTest.java
@@ -34,6 +34,7 @@ import java.io.UncheckedIOException;
 
 import org.apache.commons.fileupload2.disk.DiskFileItemFactory;
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.SerializationUtils;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -121,13 +122,7 @@ public class DiskFileItemSerializeTest {
      * Do deserialization
      */
     private Object deserialize(final ByteArrayOutputStream baos) throws 
Exception {
-        final ByteArrayInputStream bais =
-                new ByteArrayInputStream(baos.toByteArray());
-        final ObjectInputStream ois = new ObjectInputStream(bais);
-        final Object result = ois.readObject();
-        bais.close();
-
-        return result;
+        return SerializationUtils.deserialize(baos.toByteArray());
     }
 
     /**

Reply via email to