@Test
public void testOnValidateFailed() {

    when(editWorkflow.hasErrors()).thenReturn(true);
    presenter.onValidate().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());
}