@Test public void refreshOnFocusWhenOtherPlaceTest() throws NoSuchFieldException { new FieldSetter(presenter, SubmitChangeRequestScreenPresenter.class.getDeclaredField("workspaceProject")) .set(workspaceProject); PlaceRequest place = mock(PlaceRequest.class); doReturn(LibraryPlaces.PROJECT_SCREEN).when(place).getIdentifier(); presenter.refreshOnFocus(new SelectPlaceEvent(place)); verify(projectController, never()).getReadableBranches(workspaceProject); }
public void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent) { if (workspaceProject != null && workspaceProject.getMainModule() != null) { final PlaceRequest place = selectPlaceEvent.getPlace(); if (place.getIdentifier().equals(LibraryPlaces.SUBMIT_CHANGE_REQUEST)) { this.init(); } } }
SubmitChangeRequestScreenPresenter { public void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent) { if (workspaceProject != null && workspaceProject.getMainModule() != null) { final PlaceRequest place = selectPlaceEvent.getPlace(); if (place.getIdentifier().equals(LibraryPlaces.SUBMIT_CHANGE_REQUEST)) { this.init(); } } } }
SubmitChangeRequestScreenPresenter { public void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent) { if (workspaceProject != null && workspaceProject.getMainModule() != null) { final PlaceRequest place = selectPlaceEvent.getPlace(); if (place.getIdentifier().equals(LibraryPlaces.SUBMIT_CHANGE_REQUEST)) { this.init(); } } } @Inject  SubmitChangeRequestScreenPresenter(final View view,
                                              final TranslationService ts,
                                              final LibraryPlaces libraryPlaces,
                                              final ManagedInstance<DiffItemPresenter> diffItemPresenterInstances,
                                              final Caller<ChangeRequestService> changeRequestService,
                                              final ProjectController projectController,
                                              final Promises promises,
                                              final BusyIndicatorView busyIndicatorView,
                                              final ChangeRequestUtils changeRequestUtils,
                                              final Event<NotificationEvent> notificationEvent); }
SubmitChangeRequestScreenPresenter { public void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent) { if (workspaceProject != null && workspaceProject.getMainModule() != null) { final PlaceRequest place = selectPlaceEvent.getPlace(); if (place.getIdentifier().equals(LibraryPlaces.SUBMIT_CHANGE_REQUEST)) { this.init(); } } } @Inject  SubmitChangeRequestScreenPresenter(final View view,
                                              final TranslationService ts,
                                              final LibraryPlaces libraryPlaces,
                                              final ManagedInstance<DiffItemPresenter> diffItemPresenterInstances,
                                              final Caller<ChangeRequestService> changeRequestService,
                                              final ProjectController projectController,
                                              final Promises promises,
                                              final BusyIndicatorView busyIndicatorView,
                                              final ChangeRequestUtils changeRequestUtils,
                                              final Event<NotificationEvent> notificationEvent); @PostConstruct void postConstruct(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView View getView(); @OnClose void onClose(); void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent); void onRepositoryFileListUpdated(@Observes final RepositoryFileListUpdatedEvent event); void cancel(); void submit(); void selectBranch(final String branchName); void updateDiffContainer(); }
SubmitChangeRequestScreenPresenter { public void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent) { if (workspaceProject != null && workspaceProject.getMainModule() != null) { final PlaceRequest place = selectPlaceEvent.getPlace(); if (place.getIdentifier().equals(LibraryPlaces.SUBMIT_CHANGE_REQUEST)) { this.init(); } } } @Inject  SubmitChangeRequestScreenPresenter(final View view,
                                              final TranslationService ts,
                                              final LibraryPlaces libraryPlaces,
                                              final ManagedInstance<DiffItemPresenter> diffItemPresenterInstances,
                                              final Caller<ChangeRequestService> changeRequestService,
                                              final ProjectController projectController,
                                              final Promises promises,
                                              final BusyIndicatorView busyIndicatorView,
                                              final ChangeRequestUtils changeRequestUtils,
                                              final Event<NotificationEvent> notificationEvent); @PostConstruct void postConstruct(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView View getView(); @OnClose void onClose(); void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent); void onRepositoryFileListUpdated(@Observes final RepositoryFileListUpdatedEvent event); void cancel(); void submit(); void selectBranch(final String branchName); void updateDiffContainer();  }