Skip to content

Commit cdcca2e

Browse files
committed
Adding null test for CODEC-40
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@766213 13f79535-47bb-0310-9956-ffa450edef68
1 parent cb63f4a commit cdcca2e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,17 @@ public void testCodeInteger4() {
698698
assertEquals(bigInt4, Base64.decodeInteger(encodedInt4.getBytes()));
699699
}
700700

701+
public void testCodeIntegerNull() {
702+
try {
703+
Base64.encodeInteger(null);
704+
fail("Exception not thrown when passing in null to encodeInteger(BigInteger)");
705+
} catch(NullPointerException npe) {
706+
// expected
707+
} catch(Exception e) {
708+
fail("Incorrect Exception caught when passing in null to encodeInteger(BigInteger)");
709+
}
710+
}
711+
701712
public void testCodeIntegerEdgeCases() {
702713
// TODO
703714
}

0 commit comments

Comments
 (0)