@Test(expected = NumberFormatException.class) public void test_keyWithWrongByteValue_ShouldFail() { Key key = Key.create(KEY_4_NAME, Key.KEY_VALUE, KEY_4_VALUE, Key.KEY_END); // assert only to trigger key.getByte() function which throws exception assertEquals(false, Byte.parseByte(KEY_4_VALUE) == key.getByte().byteValue()); }
@Test public void test_keyWithByteValue_shouldPass() { Key key = Key.create(KEY_3_NAME, Key.KEY_VALUE, KEY_3_VALUE, Key.KEY_END); assertEquals(true, Byte.parseByte(KEY_3_VALUE) == key.getByte().byteValue()); }