void onAttributeCreated(@Observes final CreateUserAttributeEvent createUserAttributeEvent) { final Entry<String, String> entry = createUserAttributeEvent.getAttribute(); final String name = entry.getKey(); final String value = entry.getValue(); UserManager.UserAttribute attribute = getSupportedAttribute(name); attributes.put(attribute, value); redraw(); }
void addNewAttribute(final String name, final String value) { final Map.Entry<String, String> attr = createAttributeEntry(name, value); createUserAttributeEventEvent.fire(new CreateUserAttributeEvent(this, attr)); }
@Test public void testOnAttributeCreated() { final CreateUserAttributeEvent createUserAttributeEvent = mock(CreateUserAttributeEvent.class); when(createUserAttributeEvent.getContext()).thenReturn(userAttributesEditor); tested.user = user; tested.onAttributeCreated(createUserAttributeEvent); assertSetDirty(); }
@Test public void testOnAttributeCreated() { final CreateUserAttributeEvent createUserAttributeEvent = mock(CreateUserAttributeEvent.class); when(createUserAttributeEvent.getContext()).thenReturn(userAttributesEditor); tested.user = user; tested.onAttributeCreated(createUserAttributeEvent); assertSetDirty(); }
void onAttributeCreated(@Observes final CreateUserAttributeEvent createUserAttributeEvent) { final Entry<String, String> entry = createUserAttributeEvent.getAttribute(); final String name = entry.getKey(); final String value = entry.getValue(); UserManager.UserAttribute attribute = getSupportedAttribute(name); attributes.put(attribute, value); redraw(); }
void addNewAttribute(final String name, final String value) { final Map.Entry<String, String> attr = createAttributeEntry(name, value); createUserAttributeEventEvent.fire(new CreateUserAttributeEvent(this, attr)); }
when(createUserAttributeEvent.getAttribute()).thenReturn(entry); presenter.attributes = new HashMap<UserManager.UserAttribute, String>(); presenter.onAttributeCreated(createUserAttributeEvent);