GroupEditorWorkflow implements IsWidget { public void clear() { groupEditor.clear(); view.clearNotifications(); group = null; } @Inject  GroupEditorWorkflow(final ClientUserSystemManager userSystemManager,
                               final Caller<AuthorizationService> authorizationService,
                               final PermissionManager permissionManager,
                               final Event<OnErrorEvent> errorEvent,
                               final ConfirmBox confirmBox,
                               final LoadingBox loadingBox,
                               final Event<NotificationEvent> workbenchNotification,
                               final Event<SaveGroupEvent> saveGroupEvent,
                               final Event<DeleteGroupEvent> deleteGroupEvent,
                               final GroupEditor groupEditor,
                               final GroupEditorDriver groupEditorDriver,
                               final EntityWorkflowView view); @PostConstruct void setup(); @Override Widget asWidget(); GroupEditor getGroupEditor(); void show(final String name); void clear(); boolean isDirty(); public EntityWorkflowView view; }
@Test public void testClear() { tested.group = group; tested.clear(); assertNull(tested.group); verify(groupEditor, times(1)).clear(); verify(groupEditor, times(0)).show(any(Group.class)); verify(view, times(1)).clearNotifications(); verify(view, times(0)).setCancelButtonVisible(anyBoolean()); 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(0)).setSaveButtonVisible(anyBoolean()); verify(view, times(0)).setSaveButtonEnabled(anyBoolean()); verify(view, times(0)).showNotification(anyString()); }