DisplayerContainer implements IsWidget { protected void showError(ClientRuntimeError e) { error = true; if (isKieServerForbiddenException(e.getThrowable())) { view.showError(DefaultWorkbenchConstants.INSTANCE.KieServerError403(), e.getCause()); } else if (isKieServerUnauthorizedException(e.getThrowable())) { view.showError(DefaultWorkbenchConstants.INSTANCE.KieServerError401(), e.getCause()); } else { view.showEmpty(currentDisplayer); showErrorPopup(DashboardConstants.INSTANCE.dashboardCouldNotBeLoaded()); } } DisplayerContainer(Map<String, Displayer> displayers,
                              boolean showHeader); @Override Widget asWidget(); void showDisplayers(Map<String, Displayer> displayers); void selectDisplayer(String name); View getView();  }
@Test public void testShowErrorWhenIsKieServerForbiddenException() { final ClientRuntimeError clientRuntimeError = makeClientRuntimeError(makeHttpException(403)); container.showError(clientRuntimeError); verify(view).showError(DefaultWorkbenchConstants.INSTANCE.KieServerError403(), clientRuntimeError.getCause()); }
@Test public void testShowErrorWhenIsKieServerUnauthorizedException() { final ClientRuntimeError clientRuntimeError = makeClientRuntimeError(makeHttpException(401)); container.showError(clientRuntimeError); verify(view).showError(DefaultWorkbenchConstants.INSTANCE.KieServerError401(), clientRuntimeError.getCause()); }