@Test public void commentsDlgShown_onAppCommentSelectedEvent(){ AppCommentSelectedEvent eventMock = mock(AppCommentSelectedEvent.class); App appMock = mock(App.class); when(appMock.getIntegratorEmail()).thenReturn("blah@doo.com"); when(eventMock.getApp()).thenReturn(appMock); when(userInfoMock.getEmail()).thenReturn("baz@foo.com"); uut.onAppCommentSelectedEvent(eventMock); verify(commentsProviderMock).get(commentsDlgCaptor.capture()); CommentsDialog dlgMock = mock(CommentsDialog.class); commentsDlgCaptor.getValue().onSuccess(dlgMock); verify(dlgMock).show(eq(appMock), eq(false), any(AppMetadataServiceFacade.class)); }
@Override public void onAppCommentSelectedEvent(AppCommentSelectedEvent event) { final App app = event.getApp(); commentsDialogProvider.get(new AsyncCallback<CommentsDialog>() { @Override public void onFailure(Throwable caught) { announcer.schedule(new ErrorAnnouncementConfig("Something happened while trying to manage comments. Please try again or contact support for help.")); } @Override public void onSuccess(CommentsDialog result) { result.show(app, app.getIntegratorEmail().equals(userInfo.getEmail()), metadataFacade); } }); }
AppsGridPresenterImpl implements AppsGridView.Presenter,
                                              AppNameSelectedEvent.AppNameSelectedEventHandler,
                                              AppRatingSelected.AppRatingSelectedHandler,
                                              AppRatingDeselected.AppRatingDeselectedHandler,
                                              AppCommentSelectedEvent.AppCommentSelectedEventHandler,
                                              AppFavoriteSelectedEvent.AppFavoriteSelectedEventHandler,
                                              AppUpdatedEvent.AppUpdatedEventHandler { @Override public void onAppCommentSelectedEvent(AppCommentSelectedEvent event) { final App app = event.getApp(); commentsDialogProvider.get(new AsyncCallback<CommentsDialog>() { @Override public void onFailure(Throwable caught) { announcer.schedule(new ErrorAnnouncementConfig("Something happened while trying to manage comments. Please try again or contact support for help.")); } @Override public void onSuccess(CommentsDialog result) { result.show(app, app.getIntegratorEmail().equals(userInfo.getEmail()), metadataFacade); } }); } }
AppsGridPresenterImpl implements AppsGridView.Presenter,
                                              AppNameSelectedEvent.AppNameSelectedEventHandler,
                                              AppRatingSelected.AppRatingSelectedHandler,
                                              AppRatingDeselected.AppRatingDeselectedHandler,
                                              AppCommentSelectedEvent.AppCommentSelectedEventHandler,
                                              AppFavoriteSelectedEvent.AppFavoriteSelectedEventHandler,
                                              AppUpdatedEvent.AppUpdatedEventHandler { @Override public void onAppCommentSelectedEvent(AppCommentSelectedEvent event) { final App app = event.getApp(); commentsDialogProvider.get(new AsyncCallback<CommentsDialog>() { @Override public void onFailure(Throwable caught) { announcer.schedule(new ErrorAnnouncementConfig("Something happened while trying to manage comments. Please try again or contact support for help.")); } @Override public void onSuccess(CommentsDialog result) { result.show(app, app.getIntegratorEmail().equals(userInfo.getEmail()), metadataFacade); } }); } @Inject  AppsGridPresenterImpl(final AppsGridViewFactory viewFactory,
                          final ListStore<App> listStore,
                          final EventBus eventBus,
                          OntologyServiceFacade ontologyService); }
AppsGridPresenterImpl implements AppsGridView.Presenter,
                                              AppNameSelectedEvent.AppNameSelectedEventHandler,
                                              AppRatingSelected.AppRatingSelectedHandler,
                                              AppRatingDeselected.AppRatingDeselectedHandler,
                                              AppCommentSelectedEvent.AppCommentSelectedEventHandler,
                                              AppFavoriteSelectedEvent.AppFavoriteSelectedEventHandler,
                                              AppUpdatedEvent.AppUpdatedEventHandler { @Override public void onAppCommentSelectedEvent(AppCommentSelectedEvent event) { final App app = event.getApp(); commentsDialogProvider.get(new AsyncCallback<CommentsDialog>() { @Override public void onFailure(Throwable caught) { announcer.schedule(new ErrorAnnouncementConfig("Something happened while trying to manage comments. Please try again or contact support for help.")); } @Override public void onSuccess(CommentsDialog result) { result.show(app, app.getIntegratorEmail().equals(userInfo.getEmail()), metadataFacade); } }); } @Inject  AppsGridPresenterImpl(final AppsGridViewFactory viewFactory,
                          final ListStore<App> listStore,
                          final EventBus eventBus,
                          OntologyServiceFacade ontologyService); @Override HandlerRegistration addAppFavoritedEventHandler(AppFavoritedEvent.AppFavoritedEventHandler eventHandler); @Override HandlerRegistration addStoreAddHandler(StoreAddEvent.StoreAddHandler<App> handler); @Override HandlerRegistration addStoreClearHandler(StoreClearEvent.StoreClearHandler<App> handler); @Override HandlerRegistration addStoreRemoveHandler(StoreRemoveEvent.StoreRemoveHandler<App> handler); @Override HandlerRegistration addStoreUpdateHandler(StoreUpdateEvent.StoreUpdateHandler<App> handler); @Override void fireEvent(GwtEvent<?> event); App getDesiredSelectedApp(); @Override App getSelectedApp(); @Override AppsGridView getView(); @Override void onAppCategorySelectionChanged(AppCategorySelectionChangedEvent event); @Override void onOntologyHierarchySelectionChanged(OntologyHierarchySelectionChangedEvent event); @Override void onAppCommentSelectedEvent(AppCommentSelectedEvent event); @Override void onAppFavoriteSelected(AppFavoriteSelectedEvent event); @Override void onAppNameSelected(AppNameSelectedEvent event); @Override void onAppRatingDeselected(final AppRatingDeselected event); @Override void onAppRatingSelected(final AppRatingSelected event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); @Override void onAppUpdated(final AppUpdatedEvent event); @Override void onDeleteAppsSelected(final DeleteAppsSelected event); @Override void onRunAppSelected(RunAppSelected event); void setDesiredSelectedApp(final App desiredSelectedApp); }
AppsGridPresenterImpl implements AppsGridView.Presenter,
                                              AppNameSelectedEvent.AppNameSelectedEventHandler,
                                              AppRatingSelected.AppRatingSelectedHandler,
                                              AppRatingDeselected.AppRatingDeselectedHandler,
                                              AppCommentSelectedEvent.AppCommentSelectedEventHandler,
                                              AppFavoriteSelectedEvent.AppFavoriteSelectedEventHandler,
                                              AppUpdatedEvent.AppUpdatedEventHandler { @Override public void onAppCommentSelectedEvent(AppCommentSelectedEvent event) { final App app = event.getApp(); commentsDialogProvider.get(new AsyncCallback<CommentsDialog>() { @Override public void onFailure(Throwable caught) { announcer.schedule(new ErrorAnnouncementConfig("Something happened while trying to manage comments. Please try again or contact support for help.")); } @Override public void onSuccess(CommentsDialog result) { result.show(app, app.getIntegratorEmail().equals(userInfo.getEmail()), metadataFacade); } }); } @Inject  AppsGridPresenterImpl(final AppsGridViewFactory viewFactory,
                          final ListStore<App> listStore,
                          final EventBus eventBus,
                          OntologyServiceFacade ontologyService); @Override HandlerRegistration addAppFavoritedEventHandler(AppFavoritedEvent.AppFavoritedEventHandler eventHandler); @Override HandlerRegistration addStoreAddHandler(StoreAddEvent.StoreAddHandler<App> handler); @Override HandlerRegistration addStoreClearHandler(StoreClearEvent.StoreClearHandler<App> handler); @Override HandlerRegistration addStoreRemoveHandler(StoreRemoveEvent.StoreRemoveHandler<App> handler); @Override HandlerRegistration addStoreUpdateHandler(StoreUpdateEvent.StoreUpdateHandler<App> handler); @Override void fireEvent(GwtEvent<?> event); App getDesiredSelectedApp(); @Override App getSelectedApp(); @Override AppsGridView getView(); @Override void onAppCategorySelectionChanged(AppCategorySelectionChangedEvent event); @Override void onOntologyHierarchySelectionChanged(OntologyHierarchySelectionChangedEvent event); @Override void onAppCommentSelectedEvent(AppCommentSelectedEvent event); @Override void onAppFavoriteSelected(AppFavoriteSelectedEvent event); @Override void onAppNameSelected(AppNameSelectedEvent event); @Override void onAppRatingDeselected(final AppRatingDeselected event); @Override void onAppRatingSelected(final AppRatingSelected event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); @Override void onAppUpdated(final AppUpdatedEvent event); @Override void onDeleteAppsSelected(final DeleteAppsSelected event); @Override void onRunAppSelected(RunAppSelected event); void setDesiredSelectedApp(final App desiredSelectedApp);  }