@Test public void testOnShowUserEvent() { final OnShowEvent onShowEvent = mock(OnShowEvent.class); when(onShowEvent.getContext()).thenReturn(userEditor); when(onShowEvent.getInstance()).thenReturn(user); tested.onShowUserEvent(onShowEvent); verify(changeTitleNotification, times(1)).fire(any(ChangeTitleWidgetEvent.class)); }
@Test public void testOnShowUserEvent() { final OnShowEvent onShowEvent = mock(OnShowEvent.class); when(onShowEvent.getContext()).thenReturn(userEditor); when(onShowEvent.getInstance()).thenReturn(user); tested.onShowUserEvent(onShowEvent); verify(changeTitleNotification, times(1)).fire(any(ChangeTitleWidgetEvent.class)); }
void onShowUserEvent(@Observes final OnShowEvent onShowEvent) { if (checkEventContext(onShowEvent, userEditorWorkflow.getUserEditor())) { try { User user = (User) onShowEvent.getInstance(); this.userId = user.getIdentifier(); final String title = new SafeHtmlBuilder() .appendEscaped(UsersManagementWorkbenchConstants.INSTANCE.showUser(user.getIdentifier())) .toSafeHtml().asString(); changeTitleNotification.fire(new ChangeTitleWidgetEvent(placeRequest, title)); } catch (ClassCastException e) { } } }
void onShowUserEvent(@Observes final OnShowEvent onShowEvent) { if (checkEventContext(onShowEvent, userEditorWorkflow.getUserEditor())) { try { User user = (User) onShowEvent.getInstance(); this.userId = user.getIdentifier(); final String title = new SafeHtmlBuilder() .appendEscaped(UsersManagementWorkbenchConstants.INSTANCE.showUser(user.getIdentifier())) .toSafeHtml().asString(); changeTitleNotification.fire(new ChangeTitleWidgetEvent(placeRequest, title)); } catch (ClassCastException e) { } } }