UserCreationWorkflow extends BaseUserEditorWorkflow { public void create() { checkClear(); getUserEditor().setPermissionsVisible(false); createEntity.show(UsersManagementWidgetsConstants.INSTANCE.inputUserName(), UsersManagementWidgetsConstants.INSTANCE.username() + "..."); view.setWidget(createEntity.asWidget()) .setCancelButtonVisible(false) .setSaveButtonVisible(true) .setSaveButtonEnabled(true) .setSaveButtonText(UsersManagementWidgetsConstants.INSTANCE.next()) .setCallback(new EntityWorkflowView.Callback() { @Override public void onSave() { UserCreationWorkflow.this.onCreateEntityClick(); } @Override public void onCancel() { } }); } @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 testCreate() { tested.create(); verify(userEditor, times(1)).clear(); verify(userEditor, times(1)).setPermissionsVisible(false); verify(createEntity, times(1)).show(anyString(), anyString()); verify(view, times(1)).setCancelButtonVisible(false); verify(view, times(1)).setCallback(any(EntityWorkflowView.Callback.class)); verify(view, times(1)).setSaveButtonText(anyString()); verify(view, times(1)).setWidget(any(IsWidget.class)); verify(view, times(1)).setSaveButtonVisible(true); verify(view, times(1)).setSaveButtonEnabled(true); verify(view, times(2)).clearNotifications(); }