@Test public void testShowMessage() throws Exception { final ClientRuntimeError error = mock(ClientRuntimeError.class); final String message = "message"; final Throwable cause = mock(Throwable.class); final String localizedMessage = "localizedMessage"; when(cause.getLocalizedMessage()).thenReturn(localizedMessage); when(error.getMessage()).thenReturn(message); when(error.getRootCause()).thenReturn(cause); presenter.showMessage(error); verify(view, times(1)).showMessage(anyString(), any(Command.class), any(Command.class)); }
/** * Shows the given message in a modal popup that appears above all other workbench contents. * * @param msg The message to display as plain text. HTML tags are not interpreted, and newlines are rendered as newlines. * @param afterShow The command to invoke once the dialog has been displayed. Must not be null. * @param afterClose The command to invoke once the dialog has been closed. Must not be null. */ public void showMessage(final String msg, final Command afterShow, final Command afterClose) { view.showMessage(msg, checkNotNull("afterShow", afterShow), checkNotNull("afterClose", afterClose)); }
/** * Shows the given message in a modal popup that appears above all other workbench contents. * * @param msg The message to display as plain text. HTML tags are not interpreted, and newlines are rendered as newlines. */ public void showMessage(final String msg) { view.showMessage(msg, Commands.DO_NOTHING, Commands.DO_NOTHING); }