use of org.kie.workbench.common.stunner.core.client.validation.canvas.CanvasValidationFailEvent in project kie-wb-common by kiegroup.
the class NotificationsObserverTest method testNotifyValidationFailed.
@Test
@SuppressWarnings("unchecked")
public void testNotifyValidationFailed() {
final DiagramElementViolation violation = mock(DiagramElementViolation.class);
final Collection<DiagramElementViolation<RuleViolation>> violations = Collections.singletonList(violation);
validationFailedNotification = new ValidationFailedNotification(violations, notificationContext, "message1", Notification.Type.ERROR);
final CanvasValidationFailEvent validationFailEvent = new CanvasValidationFailEvent(UUID, NAME, TITLE, violations);
tested.onCanvasValidationFailEvent(validationFailEvent);
verify(onNotification, times(1)).execute(any(Notification.class));
verify(validationFailed, times(1)).execute(eq(validationFailedNotification));
verify(commandFailed, never()).execute(any(CommandNotification.class));
verify(validationSuccess, never()).execute(any(ValidationSuccessNotification.class));
verify(commandSuccess, never()).execute(any(CommandNotification.class));
}
Aggregations