InputDialogFooter extends Composite { @UiHandler("cancelButton") public void handleCancelClick(final ClickEvent event) { this.actionDelegate.cancelled(); } @Inject  InputDialogFooter(final @NotNull UILocalizationConstant messages); void setDelegate(final ActionDelegate delegate); @UiHandler("okButton") void handleOkClick(final ClickEvent event); @UiHandler("cancelButton") void handleCancelClick(final ClickEvent event);  }
@Test public void shouldCallCancelledOnCancelClicked() throws Exception { footer.handleCancelClick(mock(ClickEvent.class)); verify(actionDelegate).cancelled(); }