/** * Test removeAttribute(Serializable key), when key is null, IllegalArgumentException is expected. */ public void testRemoveAttribute_KeyIsNull() { try { tester.removeAttribute(null); fail("when key is null, IllegalArgumentException is expected."); } catch (IllegalArgumentException e) { // good } }
/** * Test setAttribute(Serializable key, Serializable value), when value is null, * IllegalArgumentException is expected. */ public void testSetAttribute_ValueIsNull() { try { tester.setAttribute("key", null); fail("when value is null, IllegalArgumentException is expected."); } catch (IllegalArgumentException e) { // good } }