ConfirmPopup { public void show(final String title, final String okButtonText, final String confirmMessage, final Command okCommand) { show(title, null, null, okButtonText, Button.ButtonStyleType.DANGER, confirmMessage, okCommand); }  @PostConstruct void init(); void show(final String title,
                     final String okButtonText,
                     final String confirmMessage,
                     final Command okCommand); void show(final String title,
                     final String inlineNotificationMessage,
                     final InlineNotification.InlineNotificationType inlineNotificationType,
                     final String okButtonText,
                     final Button.ButtonStyleType okButtonType,
                     final String confirmMessage,
                     final Command okCommand); void hide(); HTMLElement getElement(); @EventHandler("confirm-ok") void onOkClick(final @ForEvent("click") MouseEvent event); @EventHandler("confirm-cancel") void onCancelClick(final @ForEvent("click") MouseEvent event); @EventHandler("confirm-close") void onCloseClick(final @ForEvent("click") MouseEvent event);  }
@Test public void testShow() { final Command command = mock(Command.class); popup.show(TITLE, OK_BUTTON_TEXT, CONFIRM_MESSAGE, command); verify(modalTitle, times(1)).setTextContent(TITLE); verify(confirmInlineNotificationStyle, times(1)).setProperty("display", "none"); verify(okButton, times(1)).setText(OK_BUTTON_TEXT); verify(okButton, times(1)).setButtonStyleType(Button.ButtonStyleType.DANGER); verify(modalConfirmationMessageLabel, times(1)).setTextContent(CONFIRM_MESSAGE); }
@Test public void testShowWithInlineNotification() { final Command command = mock(Command.class); InlineNotification.InlineNotificationType arbitraryNotificationType = InlineNotification.InlineNotificationType.WARNING; Button.ButtonStyleType arbitraryButtonType = Button.ButtonStyleType.PRIMARY; popup.show(TITLE, INLINE_NOTIFICATION_MESSAGE, arbitraryNotificationType, OK_BUTTON_TEXT, arbitraryButtonType, CONFIRM_MESSAGE, command); verify(modalTitle, times(1)).setTextContent(TITLE); verify(confirmInlineNotificationStyle, times(1)).removeProperty("display"); verify(confirmInlineNotification, times(1)).setMessage(INLINE_NOTIFICATION_MESSAGE); verify(confirmInlineNotification, times(1)).setType(arbitraryNotificationType); verify(okButton, times(1)).setText(OK_BUTTON_TEXT); verify(okButton, times(1)).setButtonStyleType(arbitraryButtonType); verify(modalConfirmationMessageLabel, times(1)).setTextContent(CONFIRM_MESSAGE); }