UserEditorWorkflow extends BaseUserEditorWorkflow { void onChangeUserPasswordEvent(@Observes final OnChangePasswordEvent onChangePasswordEvent) { if (checkEventContext(onChangePasswordEvent, userEditor)) { doChangePassword(); } } @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 testOnChangeUserPasswordEvent() { final OnChangePasswordEvent onChangePasswordEvent = mock(OnChangePasswordEvent.class); when(onChangePasswordEvent.getContext()).thenReturn(userEditor); tested.user = user; tested.onChangeUserPasswordEvent(onChangePasswordEvent); verify(changePassword, times(1)).show(anyString(), any(ChangePassword.ChangePasswordCallback.class)); }