UserEditorWorkflow extends BaseUserEditorWorkflow { void onAttributeDeleted(@Observes final DeleteUserAttributeEvent deleteUserAttributeEvent) { if (checkEventContext(deleteUserAttributeEvent, getUserEditor().attributesEditor())) { setDirty(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 testOnAttributeDeleted() { final DeleteUserAttributeEvent deleteUserAttributeEvent = mock(DeleteUserAttributeEvent.class); when(deleteUserAttributeEvent.getContext()).thenReturn(userAttributesEditor); tested.user = user; tested.onAttributeDeleted(deleteUserAttributeEvent); assertSetDirty(); }