File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/codec/binary Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -599,6 +599,25 @@ void testDecodeEncodeStandardString(final String encodedText) {
599599 assertEquals (encodedText , encodedText2 );
600600 }
601601
602+ @ ParameterizedTest
603+ @ ValueSource (strings = {
604+ "" ,
605+ "Zg" ,
606+ "Zm8" ,
607+ "Zm9v" ,
608+ "Zm9vYg" ,
609+ "Zm9vYmE" ,
610+ "Zm9vYmFy" ,
611+ "Zm9vYmF-" ,
612+ "Zm9vYmF_"
613+ })
614+ void testDecodeEncodeUrlSafeByteArray (final String encodedText ) {
615+ final String decodedText = StringUtils .newStringUsAscii (Base64 .decodeBase64UrlSafe (encodedText .getBytes (CHARSET_UTF8 )));
616+ final String encodedText2 = Base64 .encodeBase64URLSafeString (StringUtils .getBytesUtf8 (decodedText ));
617+ assertEquals (encodedText , encodedText2 );
618+ }
619+
620+
602621 @ ParameterizedTest
603622 @ ValueSource (strings = {
604623 "" ,
You can’t perform that action at this time.
0 commit comments