BaseUserEditorWorkflow implements IsWidget { protected void edit() { setDirty(false); userEditorDriver.edit(user, userEditor); view.setCancelButtonVisible(true); view.setSaveButtonEnabled(false); view.setSaveButtonVisible(true); } BaseUserEditorWorkflow(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); @Override Widget asWidget(); void clear(); UserEditor getUserEditor(); boolean isDirty(); public EntityWorkflowView view; }
@Test public void testEdit() { tested.user = user; tested.edit(); verify(userEditorDriver, times(1)).edit(user, userEditor); verify(userEditorDriver, times(0)).show(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(); }