@Override public String toString() { return "OnEditEvent [context=" + getContext() + "]"; } }
void onEdit() { onEditEvent.fire(new OnEditEvent(UserEditor.this, user)); }
@Test public void testOnEditUserEvent() { final OnEditEvent onEditEvent = mock(OnEditEvent.class); when(onEditEvent.getContext()).thenReturn(userEditor); when(onEditEvent.getInstance()).thenReturn(user); tested.onEditUserEvent(onEditEvent); verify(changeTitleNotification, times(1)).fire(any(ChangeTitleWidgetEvent.class)); }
void onEditUserEvent(@Observes final OnEditEvent onEditEvent) { if (checkEventContext(onEditEvent, userEditorWorkflow.getUserEditor())) { try { User user = (User) onEditEvent.getInstance(); this.userId = user.getIdentifier(); changeTitleNotification.fire(new ChangeTitleWidgetEvent(placeRequest, new SafeHtmlBuilder() .appendEscaped(UsersManagementWorkbenchConstants.INSTANCE.editUser(user.getIdentifier())) .toSafeHtml().asString())); } catch (ClassCastException e) { } } }
@Test public void testOnEditUserEvent() { final OnEditEvent onEditEvent = mock(OnEditEvent.class); when(onEditEvent.getContext()).thenReturn(userEditor); when(onEditEvent.getInstance()).thenReturn(user); tested.onEditUserEvent(onEditEvent); verify(changeTitleNotification, times(1)).fire(any(ChangeTitleWidgetEvent.class)); }
void onEditUserEvent(@Observes final OnEditEvent onEditEvent) { if (checkEventContext(onEditEvent, userEditorWorkflow.getUserEditor())) { try { User user = (User) onEditEvent.getInstance(); this.userId = user.getIdentifier(); changeTitleNotification.fire(new ChangeTitleWidgetEvent(placeRequest, new SafeHtmlBuilder() .appendEscaped(UsersManagementWorkbenchConstants.INSTANCE.editUser(user.getIdentifier())) .toSafeHtml().asString())); } catch (ClassCastException e) { } } }
@Override public String toString() { return "OnEditEvent [context=" + getContext() + "]"; } }
void onEdit() { onEditEvent.fire(new OnEditEvent(RoleEditor.this, role)); }
@Test public void testOnEditUserEvent() { final OnEditEvent onEditEvent = mock(OnEditEvent.class); when(onEditEvent.getContext()).thenReturn(userEditor); tested.user = user; tested.onEditUserEvent(onEditEvent); verify(userEditorDriver, times(1)).edit(user, userEditor); verify(view, times(1)).setCancelButtonVisible(true); verify(view, times(0)).setCallback(any(EntityWorkflowView.Callback.class)); verify(view, times(0)).setSaveButtonText(anyString()); verify(view, times(0)).setWidget(any(IsWidget.class)); verify(view, times(1)).setSaveButtonVisible(true); verify(view, times(2)).setSaveButtonEnabled(false); verify(view, times(1)).showNotification(anyString()); verify(view, times(1)).clearNotifications(); verify(loadingBox, times(0)).show(); verify(loadingBox, times(0)).hide(); }
void onEdit() { onEditEvent.fire(new OnEditEvent(this, group)); }
void onEdit() { onEditEvent.fire(new OnEditEvent(this, group)); }
void onEdit() { onEditEvent.fire(new OnEditEvent(RoleEditor.this, role)); }
void onEdit() { onEditEvent.fire(new OnEditEvent(UserEditor.this, user)); }