@Test(expected = NumberFormatException.class) public void test_keyWithTooBigIntegerValue_shouldFail() { Key key = Key.create(KEY_6_NAME, Key.KEY_VALUE, KEY_6_VALUE, Key.KEY_END); // assert only to trigger key.getInteger() function which throws exception assertEquals(false, Long.parseLong(KEY_6_VALUE) == key.getInteger().intValue()); }
@Test public void test_keyWithIntegerValue_shouldPass() { Key key = Key.create(KEY_5_NAME, Key.KEY_VALUE, KEY_5_VALUE, Key.KEY_END); assertEquals(true, Integer.parseInt(KEY_5_VALUE) == key.getInteger().intValue()); }