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 c785924f5236cc1b3954e64722565ffd7d365eab Author: Gary Gregory <[email protected]> AuthorDate: Wed Jan 14 19:35:36 2026 -0500 Add missing test Base64.Base64.decodeBase64UrlSafe(byte[]) --- .../org/apache/commons/codec/binary/Base64Test.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/test/java/org/apache/commons/codec/binary/Base64Test.java b/src/test/java/org/apache/commons/codec/binary/Base64Test.java index 5b3d8f73..1b031cff 100644 --- a/src/test/java/org/apache/commons/codec/binary/Base64Test.java +++ b/src/test/java/org/apache/commons/codec/binary/Base64Test.java @@ -599,6 +599,25 @@ class Base64Test { assertEquals(encodedText, encodedText2); } + @ParameterizedTest + @ValueSource(strings = { + "", + "Zg", + "Zm8", + "Zm9v", + "Zm9vYg", + "Zm9vYmE", + "Zm9vYmFy", + "Zm9vYmF-", + "Zm9vYmF_" + }) + void testDecodeEncodeUrlSafeByteArray(final String encodedText) { + final String decodedText = StringUtils.newStringUsAscii(Base64.decodeBase64UrlSafe(encodedText.getBytes(CHARSET_UTF8))); + final String encodedText2 = Base64.encodeBase64URLSafeString(StringUtils.getBytesUtf8(decodedText)); + assertEquals(encodedText, encodedText2); + } + + @ParameterizedTest @ValueSource(strings = { "",
