UserAttributesEditor implements IsWidget,
                                             org.uberfire.ext.security.management.client.editor.user.UserAttributesEditor { @Override public void show(final User user) { this.isEditMode = false; open(user); } @Inject  UserAttributesEditor(final ClientUserSystemManager userSystemManager,
                                final ConfirmBox confirmBox,
                                final Event<CreateUserAttributeEvent> createUserAttributeEventEvent,
                                final Event<UpdateUserAttributeEvent> updateUserAttributeEventEvent,
                                final Event<DeleteUserAttributeEvent> deleteUserAttributeEventEvent,
                                final Event<OnErrorEvent> errorEvent,
                                final NewUserAttributeEditor newUserAttributeEditor,
                                final View view); @PostConstruct void init(); @Override void show(final User user); @Override void edit(final User user); @Override void flush(); @Override Map<String, String> getValue(); @Override void setViolations(Set<ConstraintViolation<User>> constraintViolations); void clear(); @Override Widget asWidget(); public View view; }
@Test public void testShow() { final User user = mock(User.class); Map<String, String> attrs = new HashMap<String, String>(1); attrs.put("attr1", "value1"); when(user.getIdentifier()).thenReturn("user1"); when(user.getProperties()).thenReturn(attrs); presenter.isEditMode = true; presenter.show(user); assertFalse(presenter.isEditMode); assertTrue(presenter.attributes.size() == 1); verify(newUserAttributeEditor, times(1)).clear(); verify(newUserAttributeEditor, times(1)).showAddButton(); verify(view, times(1)).setCanCreate(false); verify(view, times(1)).redraw(); verify(view, times(1)).getColumnCount(); verify(view, times(1)).setColumnSortHandler(any(ColumnSortEvent.ListHandler.class)); verify(view, times(2)).addColumn(any(Column.class), anyString()); verify(view, times(0)).init(any(UserAttributesEditor.class)); verify(view, times(0)).initWidgets(any(NewUserAttributeEditor.View.class)); verify(view, times(0)).removeColumn(anyInt()); }