@Test @SuppressWarnings("unchecked") public void testNotifyValidationSuccess() { validationSuccessNotification = new ValidationSuccessNotification("message", notificationContext); final CanvasValidationSuccessEvent validationSuccessEvent = new CanvasValidationSuccessEvent(UUID, NAME, TITLE); tested.onCanvasValidationSuccessEvent(validationSuccessEvent); final InOrder inOrder = inOrder(validationExecuted, onNotification, validationFailed, commandFailed, validationSuccess, commandSuccess); inOrder.verify(validationExecuted).execute(any(ValidationExecutedNotification.class)); inOrder.verify(onNotification, times(1)).execute(any(Notification.class)); inOrder.verify(validationSuccess, times(1)).execute(eq(validationSuccessNotification)); inOrder.verify(commandFailed, never()).execute(any(CommandNotification.class)); inOrder.verify(commandSuccess, never()).execute(any(CommandNotification.class)); inOrder.verify(validationFailed, never()).execute(any(ValidationFailedNotification.class)); }
@SuppressWarnings("unchecked") void onCanvasValidationSuccessEvent(final @Observes CanvasValidationSuccessEvent validationSuccessEvent) { final NotificationContext context = buildContext(validationSuccessEvent); handleValidationExecuted(context); handleValidationSuccess(context); }
NotificationsObserver { @SuppressWarnings("unchecked") void onCanvasValidationSuccessEvent(final @Observes CanvasValidationSuccessEvent validationSuccessEvent) { final NotificationContext context = buildContext(validationSuccessEvent); handleValidationExecuted(context); handleValidationSuccess(context); } }
NotificationsObserver { @SuppressWarnings("unchecked") void onCanvasValidationSuccessEvent(final @Observes CanvasValidationSuccessEvent validationSuccessEvent) { final NotificationContext context = buildContext(validationSuccessEvent); handleValidationExecuted(context); handleValidationSuccess(context); } @Inject  NotificationsObserver(final ClientTranslationService translationService); protected  NotificationsObserver(ClientTranslationService translationService, NotificationBuilder notificationBuilder); }
NotificationsObserver { @SuppressWarnings("unchecked") void onCanvasValidationSuccessEvent(final @Observes CanvasValidationSuccessEvent validationSuccessEvent) { final NotificationContext context = buildContext(validationSuccessEvent); handleValidationExecuted(context); handleValidationSuccess(context); } @Inject  NotificationsObserver(final ClientTranslationService translationService); protected  NotificationsObserver(ClientTranslationService translationService, NotificationBuilder notificationBuilder); NotificationsObserver onNotification(final ParameterizedCommand<Notification> callback); NotificationsObserver onCommandExecutionSuccess(final ParameterizedCommand<CommandNotification> callback); NotificationsObserver onCommandExecutionFailed(final ParameterizedCommand<CommandNotification> callback); NotificationsObserver onValidationSuccess(final ParameterizedCommand<ValidationSuccessNotification> callback); NotificationsObserver onValidationFailed(final ParameterizedCommand<ValidationFailedNotification> callback); NotificationsObserver onValidationExecuted(final ParameterizedCommand<ValidationExecutedNotification> callback); @PreDestroy void destroy(); }
NotificationsObserver { @SuppressWarnings("unchecked") void onCanvasValidationSuccessEvent(final @Observes CanvasValidationSuccessEvent validationSuccessEvent) { final NotificationContext context = buildContext(validationSuccessEvent); handleValidationExecuted(context); handleValidationSuccess(context); } @Inject  NotificationsObserver(final ClientTranslationService translationService); protected  NotificationsObserver(ClientTranslationService translationService, NotificationBuilder notificationBuilder); NotificationsObserver onNotification(final ParameterizedCommand<Notification> callback); NotificationsObserver onCommandExecutionSuccess(final ParameterizedCommand<CommandNotification> callback); NotificationsObserver onCommandExecutionFailed(final ParameterizedCommand<CommandNotification> callback); NotificationsObserver onValidationSuccess(final ParameterizedCommand<ValidationSuccessNotification> callback); NotificationsObserver onValidationFailed(final ParameterizedCommand<ValidationFailedNotification> callback); NotificationsObserver onValidationExecuted(final ParameterizedCommand<ValidationExecutedNotification> callback); @PreDestroy void destroy();  }