RoleEditorWorkflow extends BaseRoleEditorWorkflow { public void show(final String roleName) { doShow(roleName); } @Inject  RoleEditorWorkflow(final ClientUserSystemManager userSystemManager,
                              final Caller<AuthorizationService> authorizationService,
                              final PermissionManager permissionManager,
                              final Event<OnErrorEvent> errorEvent,
                              final Event<NotificationEvent> workbenchNotification,
                              final Event<SaveRoleEvent> saveUserEvent,
                              final ConfirmBox confirmBox,
                              final RoleEditor roleEditor,
                              final RoleEditorDriver roleEditorDriver,
                              final LoadingBox loadingBox,
                              final EntityWorkflowView view); void show(final String roleName);  }
@Test public void testClear() { tested.role = role; tested.clear(); assertNull(tested.role); verify(roleEditor).clear(); verify(roleEditor, never()).show(any(Role.class)); verify(view, atLeastOnce()).clearNotifications(); verify(view, never()).setCancelButtonVisible(true); verify(view, never()).setCallback(any(EntityWorkflowView.Callback.class)); verify(view, never()).setSaveButtonText(anyString()); verify(view, never()).setWidget(any(IsWidget.class)); verify(view, never()).setSaveButtonVisible(anyBoolean()); verify(view, never()).setSaveButtonEnabled(anyBoolean()); verify(view, never()).showNotification(anyString()); }
@Test public void testShow() { final String name = "role1"; tested.show(name); verify(view).setCancelButtonVisible(false); verify(view).setCallback(any(EntityWorkflowView.Callback.class)); verify(view).setSaveButtonText(anyString()); verify(view).setWidget(any(IsWidget.class)); verify(view).setSaveButtonVisible(false); verify(view).setSaveButtonEnabled(false); verify(view, never()).showNotification(anyString()); verify(view).clearNotifications(); verify(roleEditorDriver).edit(role, roleEditor); verify(roleEditor).clear(); }