UserCreationWorkflow extends BaseUserEditorWorkflow { protected void doEdit() { doShowEditorView(); setDirty(false); edit(); view .setSaveButtonText(UsersManagementWidgetsConstants.INSTANCE.create()) .setSaveButtonEnabled(true) .setSaveButtonVisible(true) .setCancelButtonVisible(true); getUserEditor() .setEditButtonVisible(false) .setChangePasswordButtonVisible(false) .setDeleteButtonVisible(false); } @Inject  UserCreationWorkflow(final ClientUserSystemManager userSystemManager,
                                final Event<OnErrorEvent> errorEvent,
                                final Event<NotificationEvent> workbenchNotification,
                                final Event<DeleteUserEvent> deleteUserEvent,
                                final Event<SaveUserEvent> saveUserEvent,
                                final Event<CreateUserEvent> createUserEvent,
                                final ConfirmBox confirmBox,
                                final CreateEntity createEntity,
                                final UserEditor userEditor,
                                final UserEditorDriver userEditorDriver,
                                final ChangePassword changePassword,
                                final LoadingBox loadingBox,
                                final EntityWorkflowView view); @PostConstruct void init(); void create(); @Override void clear();  }
@Test public void testDoEdit() { tested.user = user; tested.doEdit(); assertFalse(tested.isDirty); verify(userManagerService, times(0)).get(anyString()); verify(view, times(3)).setCancelButtonVisible(true); verify(view, times(1)).setCallback(any(EntityWorkflowView.Callback.class)); verify(view, times(2)).setSaveButtonText(anyString()); verify(view, times(1)).setWidget(any(IsWidget.class)); verify(view, times(3)).setSaveButtonVisible(true); verify(view, times(4)).setSaveButtonEnabled(false); verify(view, times(1)).setSaveButtonEnabled(true); verify(view, times(2)).clearNotifications(); verify(userEditor, times(0)).clear(); verify(userEditorDriver, times(0)).show(user, userEditor); verify(userEditorDriver, times(1)).edit(user, userEditor); verify(userEditor, times(1)).setEditButtonVisible(false); verify(userEditor, times(1)).setChangePasswordButtonVisible(false); verify(userEditor, times(1)).setDeleteButtonVisible(false); }