public class UtilsTest {
- @Test
- public void testLabelUtil() {
- byte[] expected = new byte[] { (byte)0x81, 0x04, 0x01, 0x02, 0x03, 0x04 };
- assertArrayEquals(expected, LabelUtil.formatLabel(4, true, true, new byte[] {1,2,3,4}));
- }
+ @Test
+ public void testLabelUtil() {
+ byte[] expected = new byte[] { (byte) 0x81, 0x04, 0x01, 0x02, 0x03, 0x04 };
+ assertArrayEquals(expected, LabelUtil.formatLabel(4, true, true, new byte[] { 1, 2, 3, 4 }));
+ }
- @Test
- public void testMessageUtil() {
- byte[] expected = new byte[] { (byte)0x20, 0x08, 0, 0x0a, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 };
- ByteBuf out = Unpooled.buffer();
- ByteBuf body = Unpooled.copiedBuffer(new byte[]{1,2,3,4,5,6});
- MessageUtil.formatMessage(8, body, out);
- assertArrayEquals(expected, ByteArray.getAllBytes(out));
- }
+ @Test
+ public void testMessageUtil() {
+ byte[] expected = new byte[] { (byte) 0x20, 0x08, 0, 0x0a, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 };
+ ByteBuf out = Unpooled.buffer();
+ ByteBuf body = Unpooled.copiedBuffer(new byte[] { 1, 2, 3, 4, 5, 6 });
+ MessageUtil.formatMessage(8, body, out);
+ assertArrayEquals(expected, ByteArray.getAllBytes(out));
+ }
- @Test
- public void testObjectUtil() {
- byte[] expected = new byte[] { 0x08, 0x13, 0, 0x06, 0x01, 0x02 };
- assertArrayEquals(expected, ObjectUtil.formatSubobject(1, 8, true, true, new byte[]{1,2}));
- }
+ @Test
+ public void testObjectUtil() {
+ byte[] expected = new byte[] { 0x08, 0x13, 0, 0x06, 0x01, 0x02 };
+ assertArrayEquals(expected, ObjectUtil.formatSubobject(1, 8, true, true, new byte[] { 1, 2 }));
+ }
}