@Test public void testShowError() { final SessionPresenterView view = spy(new SessionPresenterView()); final String message = "Hello<br />World"; final String error = "Error"; when(translationService.getTranslation(SessionPresenterView_Error)).thenReturn(error); when(view.getTranslationService()).thenReturn(translationService); when(view.getSettings()).thenReturn(settings); view.showError(message); verify(settings).setType("danger kie-session-notification"); verify(view).showNotification(error, message, IconType.EXCLAMATION_CIRCLE); }
@Override public SessionPresenterView showError(final String message) { getSettings().setType(kieNotificationCssClass(NotifyType.DANGER)); showNotification(translate(SessionPresenterView_Error), message, IconType.EXCLAMATION_CIRCLE); return this; }
SessionPresenterView extends Composite implements SessionPresenter.View { @Override public SessionPresenterView showError(final String message) { getSettings().setType(kieNotificationCssClass(NotifyType.DANGER)); showNotification(translate(SessionPresenterView_Error), message, IconType.EXCLAMATION_CIRCLE); return this; } }
SessionPresenterView extends Composite implements SessionPresenter.View { @Override public SessionPresenterView showError(final String message) { getSettings().setType(kieNotificationCssClass(NotifyType.DANGER)); showNotification(translate(SessionPresenterView_Error), message, IconType.EXCLAMATION_CIRCLE); return this; }  }
SessionPresenterView extends Composite implements SessionPresenter.View { @Override public SessionPresenterView showError(final String message) { getSettings().setType(kieNotificationCssClass(NotifyType.DANGER)); showNotification(translate(SessionPresenterView_Error), message, IconType.EXCLAMATION_CIRCLE); return this; }  @PostConstruct void init(); @Override IsWidget getCanvasWidget(); @Override IsWidget getToolbarWidget(); @Override IsWidget getSessionHeaderContainer(); @Override IsWidget getPaletteWidget(); @Override ScrollType getContentScrollType(); @Override SessionPresenterView setToolbarWidget(final IsWidget widget); @Override SessionPresenterView setSessionHeaderContainer(final IsWidget widget); @Override SessionPresenterView setPaletteWidget(final PaletteWidget<PaletteDefinition> paletteWidget); @Override SessionPresenterView setCanvasWidget(final IsWidget widget); @Override void setContentScrollType(final ScrollType type); @Override SessionPresenterView showError(final String message); @Override void showSessionHeaderContainer(final int sessionHeaderHeight); @Override void hideSessionHeaderContainer(); @Override SessionPresenter.View showWarning(final String message); @Override SessionPresenterView showMessage(final String message); @Override SessionPresenterView showLoading(final boolean loading); @Override void onResize(); void destroy(); }
SessionPresenterView extends Composite implements SessionPresenter.View { @Override public SessionPresenterView showError(final String message) { getSettings().setType(kieNotificationCssClass(NotifyType.DANGER)); showNotification(translate(SessionPresenterView_Error), message, IconType.EXCLAMATION_CIRCLE); return this; }  @PostConstruct void init(); @Override IsWidget getCanvasWidget(); @Override IsWidget getToolbarWidget(); @Override IsWidget getSessionHeaderContainer(); @Override IsWidget getPaletteWidget(); @Override ScrollType getContentScrollType(); @Override SessionPresenterView setToolbarWidget(final IsWidget widget); @Override SessionPresenterView setSessionHeaderContainer(final IsWidget widget); @Override SessionPresenterView setPaletteWidget(final PaletteWidget<PaletteDefinition> paletteWidget); @Override SessionPresenterView setCanvasWidget(final IsWidget widget); @Override void setContentScrollType(final ScrollType type); @Override SessionPresenterView showError(final String message); @Override void showSessionHeaderContainer(final int sessionHeaderHeight); @Override void hideSessionHeaderContainer(); @Override SessionPresenter.View showWarning(final String message); @Override SessionPresenterView showMessage(final String message); @Override SessionPresenterView showLoading(final boolean loading); @Override void onResize(); void destroy();  }