UserEditorWorkflow extends BaseUserEditorWorkflow { void onEditUserEvent(@Observes final OnEditEvent onEditEvent) { if (checkEventContext(onEditEvent, userEditor)) { edit(); } } @Inject  UserEditorWorkflow(final ClientUserSystemManager userSystemManager,
                              final Event<OnErrorEvent> errorEvent,
                              final Event<NotificationEvent> workbenchNotification,
                              final Event<DeleteUserEvent> deleteUserEvent,
                              final Event<SaveUserEvent> saveUserEvent,
                              final ConfirmBox confirmBox,
                              final UserEditor userEditor,
                              final UserEditorDriver userEditorDriver,
                              final ChangePassword changePassword,
                              final LoadingBox loadingBox,
                              final EntityWorkflowView view); @PostConstruct void init(); void show(final String userId);  }
@Test public void testOnEditUserEvent() { final OnEditEvent onEditEvent = mock(OnEditEvent.class); when(onEditEvent.getContext()).thenReturn(userEditor); tested.user = user; tested.onEditUserEvent(onEditEvent); verify(userEditorDriver, times(1)).edit(user, userEditor); verify(view, times(1)).setCancelButtonVisible(true); verify(view, times(0)).setCallback(any(EntityWorkflowView.Callback.class)); verify(view, times(0)).setSaveButtonText(anyString()); verify(view, times(0)).setWidget(any(IsWidget.class)); verify(view, times(1)).setSaveButtonVisible(true); verify(view, times(2)).setSaveButtonEnabled(false); verify(view, times(1)).showNotification(anyString()); verify(view, times(1)).clearNotifications(); verify(loadingBox, times(0)).show(); verify(loadingBox, times(0)).hide(); }