UserEditorWorkflow extends BaseUserEditorWorkflow { void onOnUserGroupsUpdatedEvent(@Observes final OnUpdateUserGroupsEvent onUpdateUserGroupsEvent) { if (checkEventContext(onUpdateUserGroupsEvent, getUserEditor().groupsEditor())) { setDirty(true); refreshPermissions(true); } } @Inject  UserEditorWorkflow(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); @PostConstruct void init(); void show(final String userId);  }
@Test public void testOnUserGroupsUpdatedEvent() { final OnUpdateUserGroupsEvent onUpdateUserGroupsEvent = mock(OnUpdateUserGroupsEvent.class); when(onUpdateUserGroupsEvent.getContext()).thenReturn(userAssignedGroupsEditor); tested.user = user; tested.onOnUserGroupsUpdatedEvent(onUpdateUserGroupsEvent); assertSetDirty(); }