Add missing (direct usage) tests.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1754052 13f79535-47bb-0310-9956-ffa450edef68
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 de928aa..3dc37c7 100644
--- a/src/test/java/org/apache/commons/codec/binary/HexTest.java
+++ b/src/test/java/org/apache/commons/codec/binary/HexTest.java
@@ -437,12 +437,24 @@
}
@Test
- public void testEncodeHexByteBufferZeroes() {
+ public void testEncodeHex_ByteBufferOfZeroes() {
final char[] c = Hex.encodeHex(ByteBuffer.allocate(36));
assertEquals("000000000000000000000000000000000000000000000000000000000000000000000000", new String(c));
}
@Test
+ public void testEncodeHexByteString_ByteBufferOfZeroes() {
+ final String c = Hex.encodeHexString(ByteBuffer.allocate(36));
+ assertEquals("000000000000000000000000000000000000000000000000000000000000000000000000", c);
+ }
+
+ @Test
+ public void testEncodeHexByteString_ByteArrayOfZeroes() {
+ final String c = Hex.encodeHexString(new byte[36]);
+ assertEquals("000000000000000000000000000000000000000000000000000000000000000000000000", c);
+ }
+
+ @Test
public void testEncodeStringEmpty() throws EncoderException {
assertTrue(Arrays.equals(new char[0], (char[]) new Hex().encode("")));
}