Skip to content

Commit 738b50d

Browse files
committed
Improve variable name to describe the bug in Codec 101.
1 parent ea6058c commit 738b50d

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void testCodec105() throws IOException {
9191
*/
9292
@Test
9393
public void testCodec101() throws Exception {
94-
final byte[] codec101 = StringUtils.getBytesUtf8(Base64TestData.CODEC_101_MULTIPLE_OF_3);
94+
final byte[] codec101 = StringUtils.getBytesUtf8(Base64TestData.CODEC_101_INPUT_LENGTH_IS_MULTIPLE_OF_3);
9595
final ByteArrayInputStream bais = new ByteArrayInputStream(codec101);
9696
try (final Base64InputStream in = new Base64InputStream(bais)) {
9797
final byte[] result = new byte[8192];
@@ -120,7 +120,7 @@ public void testCodec101() throws Exception {
120120
*/
121121
@Test
122122
public void testInputStreamReader() throws Exception {
123-
final byte[] codec101 = StringUtils.getBytesUtf8(Base64TestData.CODEC_101_MULTIPLE_OF_3);
123+
final byte[] codec101 = StringUtils.getBytesUtf8(Base64TestData.CODEC_101_INPUT_LENGTH_IS_MULTIPLE_OF_3);
124124
final ByteArrayInputStream bais = new ByteArrayInputStream(codec101);
125125
final Base64InputStream in = new Base64InputStream(bais);
126126
final InputStreamReader isr = new InputStreamReader(in);

src/test/java/org/apache/commons/codec/binary/Base64TestData.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
*/
2929
public class Base64TestData {
3030

31-
public static final String CODEC_101_MULTIPLE_OF_3 = "124";
31+
/**
32+
* A valid base 64 encoding that has a length that is a multiple of 3.
33+
* @see <a href="https://issues.apache.org/jira/browse/CODEC-101">Codec 101</a>
34+
*/
35+
public static final String CODEC_101_INPUT_LENGTH_IS_MULTIPLE_OF_3 = "124";
3236

3337
public static final String CODEC_98_NPE
3438
= "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM";

0 commit comments

Comments
 (0)