You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/04/02 15:47:13 UTC

[commons-fileupload] 08/08: Remove unused exceptions from test method signature

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 786d994212c06ff31d84083beb759b6c57382776
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Apr 2 11:46:01 2023 -0400

    Remove unused exceptions from test method signature
---
 src/test/java/org/apache/commons/fileupload2/FileUploadTest.java     | 5 ++---
 .../java/org/apache/commons/fileupload2/ParameterParserTest.java     | 1 -
 src/test/java/org/apache/commons/fileupload2/Util.java               | 3 +--
 .../apache/commons/fileupload2/util/mime/Base64DecoderTestCase.java  | 4 +---
 .../fileupload2/util/mime/QuotedPrintableDecoderTestCase.java        | 4 +---
 5 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/test/java/org/apache/commons/fileupload2/FileUploadTest.java b/src/test/java/org/apache/commons/fileupload2/FileUploadTest.java
index ddc6b99..461e065 100644
--- a/src/test/java/org/apache/commons/fileupload2/FileUploadTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/FileUploadTest.java
@@ -22,7 +22,6 @@ import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
 import java.util.stream.Stream;
@@ -108,7 +107,7 @@ public class FileUploadTest {
     @ParameterizedTest
     @MethodSource("data")
     public void testEmptyFile(final FileUpload upload)
-            throws UnsupportedEncodingException, FileUploadException {
+            throws FileUploadException {
         final List<FileItem> fileItems = Util.parseUpload (upload,
                                                 "-----1234\r\n" +
                                                 "Content-Disposition: form-data; name=\"file\"; filename=\"\"\r\n" +
@@ -355,7 +354,7 @@ public class FileUploadTest {
     @ParameterizedTest
     @MethodSource("data")
     public void testIE5MacBug(final FileUpload upload)
-            throws UnsupportedEncodingException, FileUploadException {
+            throws FileUploadException {
         final List<FileItem> fileItems = Util.parseUpload(upload,
                                                "-----1234\r\n" +
                                                "Content-Disposition: form-data; name=\"field1\"\r\n" +
diff --git a/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java b/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java
index 134e41f..d59286d 100644
--- a/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java
+++ b/src/test/java/org/apache/commons/fileupload2/ParameterParserTest.java
@@ -19,7 +19,6 @@ package org.apache.commons.fileupload2;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
 
-import java.io.UnsupportedEncodingException;
 import java.util.Map;
 
 import org.junit.jupiter.api.Test;
diff --git a/src/test/java/org/apache/commons/fileupload2/Util.java b/src/test/java/org/apache/commons/fileupload2/Util.java
index 9b3aa24..b35a517 100644
--- a/src/test/java/org/apache/commons/fileupload2/Util.java
+++ b/src/test/java/org/apache/commons/fileupload2/Util.java
@@ -16,7 +16,6 @@
  */
 package org.apache.commons.fileupload2;
 
-import java.io.UnsupportedEncodingException;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.List;
@@ -56,7 +55,7 @@ public class Util {
     }
 
     public static List<FileItem> parseUpload(final FileUpload upload, final String content)
-        throws UnsupportedEncodingException, FileUploadException {
+        throws FileUploadException {
         final byte[] bytes = content.getBytes(StandardCharsets.US_ASCII);
         return parseUpload(upload, bytes, Constants.CONTENT_TYPE);
     }
diff --git a/src/test/java/org/apache/commons/fileupload2/util/mime/Base64DecoderTestCase.java b/src/test/java/org/apache/commons/fileupload2/util/mime/Base64DecoderTestCase.java
index 857bd90..ead3263 100644
--- a/src/test/java/org/apache/commons/fileupload2/util/mime/Base64DecoderTestCase.java
+++ b/src/test/java/org/apache/commons/fileupload2/util/mime/Base64DecoderTestCase.java
@@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.nio.charset.StandardCharsets;
 
 import org.junit.jupiter.api.Test;
@@ -44,8 +43,7 @@ public final class Base64DecoderTestCase {
         assertArrayEquals(expected, actual);
     }
 
-    private static void assertIOException(final String messageText, final String encoded)
-            throws UnsupportedEncodingException {
+    private static void assertIOException(final String messageText, final String encoded) {
         final ByteArrayOutputStream out = new ByteArrayOutputStream(encoded.length());
         final byte[] encodedData = encoded.getBytes(StandardCharsets.US_ASCII);
         try {
diff --git a/src/test/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoderTestCase.java b/src/test/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoderTestCase.java
index f685a06..c8831f6 100644
--- a/src/test/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoderTestCase.java
+++ b/src/test/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoderTestCase.java
@@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.nio.charset.StandardCharsets;
 
 import org.junit.jupiter.api.Test;
@@ -44,8 +43,7 @@ public final class QuotedPrintableDecoderTestCase {
         assertArrayEquals(expected, actual);
     }
 
-    private static void assertIOException(final String messageText, final String encoded)
-            throws UnsupportedEncodingException {
+    private static void assertIOException(final String messageText, final String encoded) {
         final ByteArrayOutputStream out = new ByteArrayOutputStream(encoded.length());
         final byte[] encodedData = encoded.getBytes(StandardCharsets.US_ASCII);
         try {