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-codec.git
commit 54677f44b2efdf52cade07c7dcf20c856fc7a6cc Author: Gary Gregory <[email protected]> AuthorDate: Sun May 22 07:27:12 2022 -0400 Remove unused exceptions --- src/test/java/org/apache/commons/codec/binary/Base16Test.java | 2 +- src/test/java/org/apache/commons/codec/binary/HexTest.java | 2 +- .../java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java | 4 ++-- .../apache/commons/codec/language/bm/BeiderMorseEncoderTest.java | 2 +- src/test/java/org/apache/commons/codec/net/BCodecTest.java | 2 +- src/test/java/org/apache/commons/codec/net/URLCodecTest.java | 9 +++++---- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/test/java/org/apache/commons/codec/binary/Base16Test.java b/src/test/java/org/apache/commons/codec/binary/Base16Test.java index a015c699..0ce8b0d9 100644 --- a/src/test/java/org/apache/commons/codec/binary/Base16Test.java +++ b/src/test/java/org/apache/commons/codec/binary/Base16Test.java @@ -412,7 +412,7 @@ public class Base16Test { } @Test - public void testByteToStringVariations() throws DecoderException { + public void testByteToStringVariations() { final Base16 base16 = new Base16(); final byte[] b1 = StringUtils.getBytesUtf8("Hello World"); final byte[] b2 = {}; diff --git a/src/test/java/org/apache/commons/codec/binary/HexTest.java b/src/test/java/org/apache/commons/codec/binary/HexTest.java index 19104cff..5d21ea2b 100644 --- a/src/test/java/org/apache/commons/codec/binary/HexTest.java +++ b/src/test/java/org/apache/commons/codec/binary/HexTest.java @@ -396,7 +396,7 @@ public class HexTest { } @Test - public void testEncodeDecodeHexCharArrayRandomToOutput() throws DecoderException, EncoderException { + public void testEncodeDecodeHexCharArrayRandomToOutput() throws DecoderException { for (int i = 5; i > 0; i--) { final byte[] data = new byte[ThreadLocalRandom.current().nextInt(10000) + 1]; ThreadLocalRandom.current().nextBytes(data); diff --git a/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java b/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java index 4a8bbb65..12bf2bf2 100644 --- a/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java +++ b/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java @@ -156,7 +156,7 @@ public class HmacAlgorithmsTest { @ParameterizedTest @MethodSource("data") - public void testHmacFailInputStream(HmacAlgorithms hmacAlgorithm, byte[] standardResultBytes, String standardResultString) throws IOException { + public void testHmacFailInputStream(HmacAlgorithms hmacAlgorithm, byte[] standardResultBytes, String standardResultString) { assumeTrue(HmacUtils.isAvailable(hmacAlgorithm)); assertThrows(IllegalArgumentException.class, () -> new HmacUtils(hmacAlgorithm, (byte[]) null).hmac(new ByteArrayInputStream(STANDARD_PHRASE_BYTES))); } @@ -177,7 +177,7 @@ public class HmacAlgorithmsTest { @ParameterizedTest @MethodSource("data") - public void testHmacHexFailInputStream(HmacAlgorithms hmacAlgorithm, byte[] standardResultBytes, String standardResultString) throws IOException { + public void testHmacHexFailInputStream(HmacAlgorithms hmacAlgorithm, byte[] standardResultBytes, String standardResultString) { assumeTrue(HmacUtils.isAvailable(hmacAlgorithm)); assertThrows(IllegalArgumentException.class, () -> new HmacUtils(hmacAlgorithm, (byte[]) null).hmac(new ByteArrayInputStream(STANDARD_PHRASE_BYTES))); } diff --git a/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java b/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java index 3e65734f..19140c6e 100644 --- a/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java +++ b/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java @@ -123,7 +123,7 @@ public class BeiderMorseEncoderTest extends StringEncoderAbstractTest<StringEnco } @Test - public void testLongestEnglishSurname() throws EncoderException { + public void testLongestEnglishSurname() { final BeiderMorseEncoder bmpm = createGenericApproxEncoder(); assertTimeout(Duration.ofMillis(10000L), () -> bmpm.encode("MacGhilleseatheanaich")); } diff --git a/src/test/java/org/apache/commons/codec/net/BCodecTest.java b/src/test/java/org/apache/commons/codec/net/BCodecTest.java index 276aeedd..5b046007 100644 --- a/src/test/java/org/apache/commons/codec/net/BCodecTest.java +++ b/src/test/java/org/apache/commons/codec/net/BCodecTest.java @@ -165,7 +165,7 @@ public class BCodecTest { } @Test - public void testBase64ImpossibleSamplesStrict() throws DecoderException { + public void testBase64ImpossibleSamplesStrict() { final BCodec codec = new BCodec(StandardCharsets.UTF_8, CodecPolicy.STRICT); assertTrue(codec.isStrictDecoding()); for (final String s : BASE64_IMPOSSIBLE_CASES) { diff --git a/src/test/java/org/apache/commons/codec/net/URLCodecTest.java b/src/test/java/org/apache/commons/codec/net/URLCodecTest.java index 08bbf222..366d7719 100644 --- a/src/test/java/org/apache/commons/codec/net/URLCodecTest.java +++ b/src/test/java/org/apache/commons/codec/net/URLCodecTest.java @@ -17,7 +17,10 @@ package org.apache.commons.codec.net; -import java.io.UnsupportedEncodingException; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + import java.nio.charset.StandardCharsets; import org.apache.commons.codec.CharEncoding; @@ -25,8 +28,6 @@ import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.EncoderException; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - /** * URL codec test cases * @@ -131,7 +132,7 @@ public class URLCodecTest { } @Test - public void testDecodeInvalidContent() throws UnsupportedEncodingException, DecoderException { + public void testDecodeInvalidContent() throws DecoderException { final String ch_msg = constructString(SWISS_GERMAN_STUFF_UNICODE); final URLCodec urlCodec = new URLCodec(); final byte[] input = ch_msg.getBytes(StandardCharsets.ISO_8859_1);
