@Test @SuppressWarnings("unchecked") public void testXMLSave_ValidationNotRequired() { final String xml = "xml"; final ServiceCallback<String> serviceCallback = assertBasicXMLSaveOperation(xml); serviceCallback.onSuccess(xml); final Path path = versionRecordManager.getCurrentPath(); verify(versionRecordManager).reloadVersions(eq(path)); ArgumentCaptor<NotificationEvent> notificationEventCaptor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notification, times(2)).fire(notificationEventCaptor.capture()); final NotificationEvent notificationEvent = notificationEventCaptor.getValue(); assertEquals("ItemSavedSuccessfully", notificationEvent.getNotification()); verify(view, atLeastOnce()).hideBusyIndicator(); }
times(1)).fire(notification.capture()); assertEquals(CommonConstants.INSTANCE.ItemSavedSuccessfully(), notification.getValue().getNotification());
@Override public NotificationPopupHandle show( NotificationEvent event, Command hideCommand ) { if ( container == null ) { throw new IllegalStateException( "The setContainer() method hasn't been called!" ); } final NotificationPopupView view = new NotificationPopupView(); final PopupHandle popupHandle = new PopupHandle( view, event ); activeNotifications.add( popupHandle ); int size = activeNotifications.size(); int topMargin = (size == 1) ? initialSpacing : (size * SPACING) - (SPACING - initialSpacing); view.setPopupPosition( getLeftPosition( container.asWidget() ) + getMargin(), getTopPosition( container.asWidget() ) + topMargin ); view.setNotification( event.getNotification() ); view.setType( event.getType() ); view.setNotificationWidth( getWidth() + "px" ); view.show( hideCommand ); return popupHandle; }
@Override public NotificationPopupHandle show(NotificationEvent event, Command hideCommand) { if (container == null) { throw new IllegalStateException("The setContainer() method hasn't been called!"); } final NotificationPopupView view = new NotificationPopupView(); final PopupHandle popupHandle = new PopupHandle(view, event); activeNotifications.add(popupHandle); int size = activeNotifications.size(); int topMargin = (size == 1) ? initialSpacing : (size * SPACING) - (SPACING - initialSpacing); view.setPopupPosition(getLeftPosition(container.asWidget()) + getMargin(), getTopPosition(container.asWidget()) + topMargin); view.setNotification(event.getNotification()); view.setType(event.getType()); view.setNotificationWidth(getWidth() + "px"); view.show(hideCommand); return popupHandle; }
@Override public NotificationPopupHandle show(NotificationEvent event, Command hideCommand) { if (container == null) { throw new IllegalStateException("The setContainer() method hasn't been called!"); } final NotificationPopupView view = new NotificationPopupView(); final PopupHandle popupHandle = new PopupHandle(view, event); activeNotifications.add(popupHandle); int size = activeNotifications.size(); int topMargin = (size == 1) ? initialSpacing : (size * SPACING) - (SPACING - initialSpacing); view.setPopupPosition(getLeftPosition(container.asWidget()) + getMargin(), getTopPosition(container.asWidget()) + topMargin); view.setNotification(event.getNotification()); view.setType(event.getType()); view.setNotificationWidth(getWidth() + "px"); view.show(hideCommand); return popupHandle; }
captor.getAllValues().get(1).getType()); assertEquals(Constants.INSTANCE.RequestScheduled(firstJobId), captor.getAllValues().get(0).getNotification()); assertEquals(Constants.INSTANCE.RequestScheduled(secondJobId), captor.getAllValues().get(1).getNotification());
event.getType()); assertEquals(successMessage, event.getNotification());
@Test public void confirmPopupTest() { final ProcessInstanceSummary summary = ProcessInstanceSummary.builder().withServerTemplateId(SERVER_TEMPLATE_ID).withDeploymentId(PI_DEPLOYMENT_ID).withProcessInstanceId(PI_ID).withState(1).build(); when(processRuntimeDataService.getProcessInstance(any())).thenReturn(summary); presenter.onProcessSelectionEvent(new ProcessInstanceSelectionEvent(summary.getProcessInstanceKey(), true)); presenter.openAbortProcessInstancePopup(); ArgumentCaptor<Command> captureCommand = ArgumentCaptor.forClass(Command.class); verify(confirmPopup).show(any(), any(), any(), captureCommand.capture()); remoteProcessServiceCaller = new CallerMock<>(processService); presenter.setProcessService(remoteProcessServiceCaller); captureCommand.getValue().execute(); final ArgumentCaptor<NotificationEvent> captor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notificationEvent).fire(captor.capture()); assertEquals(1, captor.getAllValues().size()); assertEquals(NotificationEvent.NotificationType.DEFAULT, captor.getValue().getType()); assertEquals(Constants.INSTANCE.Aborting_Process_Instance(PI_ID), captor.getValue().getNotification()); verify(processService).abortProcessInstance(new ProcessInstanceKey(SERVER_TEMPLATE_ID, PI_DEPLOYMENT_ID, PI_ID)); }
verify( notification ).fire( eventCaptor.capture() ); final NotificationEvent event = eventCaptor.getValue(); assertEquals( successMessage, event.getNotification() ); assertEquals( NotificationEvent.NotificationType.SUCCESS, event.getType() );