@Test(expected = KeyInvalidName.class) public void test_keySetName_shouldFail() { String new_keyname = "some_random/test/stuff_or/whatever"; // initial slash missing Key key = Key.create(KEY_1_NAME, Key.KEY_VALUE, KEY_1_VALUE, Key.KEY_END); key.setName(new_keyname); assertEquals(new_keyname, key.getName()); }
@Test public void test_keySetName_shouldPass() { String new_keyname = "/some_random/test/stuff_or/whatever"; Key key = Key.create(KEY_1_NAME, Key.KEY_VALUE, KEY_1_VALUE, Key.KEY_END); key.setName(new_keyname); assertEquals(new_keyname, key.getName()); }