@Test public void refreshOnFocusOtherPlaceTest() { PlaceRequest place = mock(PlaceRequest.class); SelectPlaceEvent event = new SelectPlaceEvent(place); doReturn(LibraryPlaces.PROJECT_SCREEN).when(place).getIdentifier(); presenter.refreshOnFocus(event); verify(changeRequestService, never()).getChangeRequest(anyString(), anyString(), anyLong()); }
public void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent) { if (workspaceProject != null && workspaceProject.getMainModule() != null) { final PlaceRequest place = selectPlaceEvent.getPlace(); if (place.getIdentifier().equals(LibraryPlaces.CHANGE_REQUEST_REVIEW)) { final String changeRequestIdValue = place.getParameter(ChangeRequestUtils.CHANGE_REQUEST_ID_KEY, null); if (changeRequestIdValue != null && !changeRequestIdValue.equals("")) { this.currentChangeRequestId = Long.parseLong(changeRequestIdValue); this.loadContent(); } } } }
ChangeRequestReviewScreenPresenter { public void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent) { if (workspaceProject != null && workspaceProject.getMainModule() != null) { final PlaceRequest place = selectPlaceEvent.getPlace(); if (place.getIdentifier().equals(LibraryPlaces.CHANGE_REQUEST_REVIEW)) { final String changeRequestIdValue = place.getParameter(ChangeRequestUtils.CHANGE_REQUEST_ID_KEY, null); if (changeRequestIdValue != null && !changeRequestIdValue.equals("")) { this.currentChangeRequestId = Long.parseLong(changeRequestIdValue); this.loadContent(); } } } } }
ChangeRequestReviewScreenPresenter { public void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent) { if (workspaceProject != null && workspaceProject.getMainModule() != null) { final PlaceRequest place = selectPlaceEvent.getPlace(); if (place.getIdentifier().equals(LibraryPlaces.CHANGE_REQUEST_REVIEW)) { final String changeRequestIdValue = place.getParameter(ChangeRequestUtils.CHANGE_REQUEST_ID_KEY, null); if (changeRequestIdValue != null && !changeRequestIdValue.equals("")) { this.currentChangeRequestId = Long.parseLong(changeRequestIdValue); this.loadContent(); } } } } @Inject  ChangeRequestReviewScreenPresenter(final View view,
                                              final TranslationService ts,
                                              final LibraryPlaces libraryPlaces,
                                              final Caller<ChangeRequestService> changeRequestService,
                                              final Caller<RepositoryService> repositoryService,
                                              final BusyIndicatorView busyIndicatorView,
                                              final OverviewScreenPresenter overviewScreen,
                                              final ChangedFilesScreenPresenter changedFilesScreen,
                                              final Promises promises,
                                              final ProjectController projectController,
                                              final Event<NotificationEvent> notificationEvent,
                                              final SessionInfo sessionInfo,
                                              final SquashChangeRequestPopUpPresenter squashChangeRequestPopUpPresenter); }
ChangeRequestReviewScreenPresenter { public void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent) { if (workspaceProject != null && workspaceProject.getMainModule() != null) { final PlaceRequest place = selectPlaceEvent.getPlace(); if (place.getIdentifier().equals(LibraryPlaces.CHANGE_REQUEST_REVIEW)) { final String changeRequestIdValue = place.getParameter(ChangeRequestUtils.CHANGE_REQUEST_ID_KEY, null); if (changeRequestIdValue != null && !changeRequestIdValue.equals("")) { this.currentChangeRequestId = Long.parseLong(changeRequestIdValue); this.loadContent(); } } } } @Inject  ChangeRequestReviewScreenPresenter(final View view,
                                              final TranslationService ts,
                                              final LibraryPlaces libraryPlaces,
                                              final Caller<ChangeRequestService> changeRequestService,
                                              final Caller<RepositoryService> repositoryService,
                                              final BusyIndicatorView busyIndicatorView,
                                              final OverviewScreenPresenter overviewScreen,
                                              final ChangedFilesScreenPresenter changedFilesScreen,
                                              final Promises promises,
                                              final ProjectController projectController,
                                              final Event<NotificationEvent> notificationEvent,
                                              final SessionInfo sessionInfo,
                                              final SquashChangeRequestPopUpPresenter squashChangeRequestPopUpPresenter); @PostConstruct void postConstruct(); void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent); void onChangeRequestUpdated(@Observes final ChangeRequestUpdatedEvent event); void onChangeRequestStatusUpdated(@Observes final ChangeRequestStatusUpdatedEvent event); void onRepositoryFileListUpdated(@Observes final RepositoryFileListUpdatedEvent event); void onRepositoryUpdated(@Observes final RepositoryUpdatedEvent event); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView View getView(); void showOverviewContent(); void showChangedFilesContent(); void cancel(); void reject(); void squash(); void merge(); void revert(); void close(); void reopen(); }
ChangeRequestReviewScreenPresenter { public void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent) { if (workspaceProject != null && workspaceProject.getMainModule() != null) { final PlaceRequest place = selectPlaceEvent.getPlace(); if (place.getIdentifier().equals(LibraryPlaces.CHANGE_REQUEST_REVIEW)) { final String changeRequestIdValue = place.getParameter(ChangeRequestUtils.CHANGE_REQUEST_ID_KEY, null); if (changeRequestIdValue != null && !changeRequestIdValue.equals("")) { this.currentChangeRequestId = Long.parseLong(changeRequestIdValue); this.loadContent(); } } } } @Inject  ChangeRequestReviewScreenPresenter(final View view,
                                              final TranslationService ts,
                                              final LibraryPlaces libraryPlaces,
                                              final Caller<ChangeRequestService> changeRequestService,
                                              final Caller<RepositoryService> repositoryService,
                                              final BusyIndicatorView busyIndicatorView,
                                              final OverviewScreenPresenter overviewScreen,
                                              final ChangedFilesScreenPresenter changedFilesScreen,
                                              final Promises promises,
                                              final ProjectController projectController,
                                              final Event<NotificationEvent> notificationEvent,
                                              final SessionInfo sessionInfo,
                                              final SquashChangeRequestPopUpPresenter squashChangeRequestPopUpPresenter); @PostConstruct void postConstruct(); void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent); void onChangeRequestUpdated(@Observes final ChangeRequestUpdatedEvent event); void onChangeRequestStatusUpdated(@Observes final ChangeRequestStatusUpdatedEvent event); void onRepositoryFileListUpdated(@Observes final RepositoryFileListUpdatedEvent event); void onRepositoryUpdated(@Observes final RepositoryUpdatedEvent event); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView View getView(); void showOverviewContent(); void showChangedFilesContent(); void cancel(); void reject(); void squash(); void merge(); void revert(); void close(); void reopen();  }