AbstractScenarioPopupView implements AbstractScenarioPopup { @EventHandler("ok-button") public void onOkClick(final @ForEvent("click") MouseEvent event) { if (okCommand != null) { okCommand.execute(); } hide(); }  @PostConstruct void init(); @Override void show(final String mainTitleText,
                     final String okButtonText,
                     final Command okCommand); @Override HTMLElement getElement(); @Override void hide(); @EventHandler("ok-button") void onOkClick(final @ForEvent("click") MouseEvent event); @EventHandler("cancel-button") void onCancelClick(final @ForEvent("click") MouseEvent event);  }
@Test public void onOkClick() { popupView.okCommand = null; popupView.onOkClick(mouseEventMock); verify(okCommandMock, never()).execute(); verify(popupView, times(1)).hide(); reset(popupView); popupView.okCommand = okCommandMock; popupView.onOkClick(mouseEventMock); verify(okCommandMock, times(1)).execute(); verify(popupView, times(1)).hide(); }