@Test public void test_dontPaintHasFormItemClickHandlersAttributeWhenNoHandlerRegistered() throws PaintException { final PaintTarget paintTarget = mock(JsonPaintTarget.class); formItemIcon.paintContent(paintTarget); verify(paintTarget, never()).addAttribute(eq("hasFormItemClickHandlers"), anyBoolean()); }
@Test public void test_paintHasFormItemClickHandlersAttributeWhenHandlersAreRegistered() throws PaintException { formItemIcon.addFormItemClickHandler(mock(FormItemClickHandler.class)); final PaintTarget paintTarget = mock(JsonPaintTarget.class); formItemIcon.paintContent(paintTarget); verify(paintTarget).addAttribute("hasFormItemClickHandlers", true); }