@Test
public void testFormatTlvASCII() throws Exception {
final ByteBuf out = Unpooled.buffer(TLV_ASCII_OUT.length);
- TlvUtil.formatTlvUtf8(1, "Name", out);
+ TlvUtil.formatTlvAscii(1, "Name", out);
Assert.assertArrayEquals(TLV_ASCII_OUT, ByteArray.getAllBytes(out));
}
throw e.getCause();
}
}
+
+ @Test(expected=UnsupportedOperationException.class)
+ public void testTlvUtilPrivateConstructor() throws Throwable {
+ final Constructor<TlvUtil> c = TlvUtil.class.getDeclaredConstructor();
+ c.setAccessible(true);
+ try {
+ c.newInstance();
+ } catch (final InvocationTargetException e) {
+ throw e.getCause();
+ }
+ }
}
\ No newline at end of file