Refine search
@Override public void callback(Boolean result) { if (result) notification.fire(new NotificationEvent("Form persisted OK!", NotificationEvent.NotificationType.SUCCESS)); else notification.fire(new NotificationEvent("Something wrong happened persisting form", NotificationEvent.NotificationType.ERROR)); } }).persistContext(context.getCtxUID());
protected void assertNotification(final NotificationEvent.NotificationType notificationType) { final ArgumentCaptor<NotificationEvent> captor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notification).fire(captor.capture()); assertEquals(notificationType, captor.getValue().getType()); } }
@Test public void testCreateInvalidCaseInstance() { presenter.createCaseInstance(null, anyString(), null); final ArgumentCaptor<NotificationEvent> captor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notificationEvent).fire(captor.capture()); assertEquals(1, captor.getAllValues().size()); assertEquals(NotificationEvent.NotificationType.ERROR, captor.getValue().getType()); }
protected void assertNotification(final NotificationEvent.NotificationType notificationType) { final ArgumentCaptor<NotificationEvent> captor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notification).fire(captor.capture()); assertEquals(notificationType, captor.getValue().getType()); } }
@Test public void testCreateInvalidCaseInstance() { presenter.createCaseInstance(null, anyString(), null); final ArgumentCaptor<NotificationEvent> captor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notificationEvent).fire(captor.capture()); assertEquals(1, captor.getAllValues().size()); assertEquals(NotificationEvent.NotificationType.ERROR, captor.getValue().getType()); }
@Override public void displayNotification(final String text) { notification.fire(new NotificationEvent(text)); } }
@Test public void testRemoveError() { final ServerInstanceKey serverInstanceKey = new ServerInstanceKey( "templateId", "serverName", "serverInstanceId", "url" ); presenter.onSelect( new ServerInstanceSelected( serverInstanceKey ) ); doThrow( new RuntimeException() ).when( specManagementService ).deleteServerInstance( serverInstanceKey ); presenter.remove(); final ArgumentCaptor<NotificationEvent> notificationCaptor = ArgumentCaptor.forClass( NotificationEvent.class ); verify( notification ).fire( notificationCaptor.capture() ); assertEquals( NotificationEvent.NotificationType.ERROR, notificationCaptor.getValue().getType() ); }
@Test public void testNotificationOnStartProcessWithJavaScriptObject() { ftlStartProcessDisplayer.startProcess( mock( JavaScriptObject.class ) ); verify( newProcessInstanceEvent ).fire( any( NewProcessInstanceEvent.class ) ); ArgumentCaptor<NotificationEvent> argument = ArgumentCaptor.forClass( NotificationEvent.class ); verify( notificationEvent ).fire( argument.capture() ); assertEquals( NotificationEvent.NotificationType.SUCCESS, argument.getValue().getType() ); } }
@Override public void displayNotification(final String text) { notification.fire(new NotificationEvent(text)); } }
@Test public void testOnValidateFailed() { when(editWorkflow.hasErrors()).thenReturn(true); presenter.getValidateCommand().execute(); verify(editWorkflow, times(1)).flush(); final ArgumentCaptor<NotificationEvent> dataCaptor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notification, times(1)).fire(dataCaptor.capture()); NotificationEvent ne = dataCaptor.getValue(); assertNotNull(ne); assertEquals(NotificationEvent.NotificationType.ERROR, ne.getType()); }
@Override public void displayNotification(String text) { notification.fire(new NotificationEvent(text)); } }
@Test public void testOnValidateSuccess() { when(editWorkflow.hasErrors()).thenReturn(false); presenter.getValidateCommand().execute(); verify(editWorkflow, times(1)).flush(); final ArgumentCaptor<NotificationEvent> dataCaptor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notification, times(1)).fire(dataCaptor.capture()); NotificationEvent ne = dataCaptor.getValue(); assertNotNull(ne); assertEquals(NotificationEvent.NotificationType.SUCCESS, ne.getType()); }
private void notifyValidationSuccess() { // the null check is due to tests that are not able to inject Event instance if (notificationEvent != null) { notificationEvent.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemValidatedSuccessfully(), NotificationEvent.NotificationType.SUCCESS)); } } }
@Test public void testOnValidateSuccess() { when(editWorkflow.hasErrors()).thenReturn(false); presenter.getValidateCommand().execute(); verify(editWorkflow, times(1)).flush(); final ArgumentCaptor<NotificationEvent> dataCaptor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notification, times(1)).fire(dataCaptor.capture()); NotificationEvent ne = dataCaptor.getValue(); assertNotNull(ne); assertEquals(NotificationEvent.NotificationType.SUCCESS, ne.getType()); }
@Override public void callback( final Void aVoid ) { notification.fire( new NotificationEvent( view.getRemoteInstanceRemoveSuccessMessage(), NotificationEvent.NotificationType.SUCCESS ) ); } }, new ErrorCallback<Object>() {
@Test public void testOnValidateFailed() { when(editWorkflow.hasErrors()).thenReturn(true); presenter.getValidateCommand().execute(); verify(editWorkflow, times(1)).flush(); final ArgumentCaptor<NotificationEvent> dataCaptor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notification, times(1)).fire(dataCaptor.capture()); NotificationEvent ne = dataCaptor.getValue(); assertNotNull(ne); assertEquals(NotificationEvent.NotificationType.ERROR, ne.getType()); }
@Override public void showOnlySingleEntryAllowed() { notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Only_single_entry_allowed(), NotificationEvent.NotificationType.ERROR)); }
@Test public void testNotificationOnStartProcess() { getStartProcessFormDisplayer().setParentProcessInstanceId( 0L ); getStartProcessFormDisplayer().startProcess( new HashMap<String, Object>() ); verify( newProcessInstanceEvent ).fire( any( NewProcessInstanceEvent.class ) ); ArgumentCaptor<NotificationEvent> argument = ArgumentCaptor.forClass( NotificationEvent.class ); verify( notificationEvent ).fire( argument.capture() ); assertEquals( NotificationEvent.NotificationType.SUCCESS, argument.getValue().getType() ); } }
@Override public void callback(Path path) { notification.fire(new NotificationEvent( translationService.format( DataSourceManagementConstants.NewDataSourceDefWizard_DataSourceCreatedMessage, path.toString()))); NewDataSourceDefWizard.super.complete(); } };
@Test public void testNotificationOnStartProcess() { getStartProcessFormDisplayer().setParentProcessInstanceId(0L); getStartProcessFormDisplayer().startProcess(new HashMap<String, Object>()); verify(newProcessInstanceEvent).fire(any(NewProcessInstanceEvent.class)); ArgumentCaptor<NotificationEvent> argument = ArgumentCaptor.forClass(NotificationEvent.class); verify(notificationEvent).fire(argument.capture()); assertEquals(NotificationEvent.NotificationType.SUCCESS, argument.getValue().getType()); } }