### Question:
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();  }### Answer:
@Test public void refreshOnFocusTest() throws NoSuchFieldException { new FieldSetter(presenter, SubmitChangeRequestScreenPresenter.class.getDeclaredField("workspaceProject")) .set(workspaceProject); PlaceRequest place = mock(PlaceRequest.class); doReturn(LibraryPlaces.SUBMIT_CHANGE_REQUEST).when(place).getIdentifier(); presenter.refreshOnFocus(new SelectPlaceEvent(place)); verify(projectController).getReadableBranches(workspaceProject); verify(view).resetAll(); verify(busyIndicatorView).showBusyIndicator(anyString()); verify(view).clearDiffList(); verify(changeRequestService).getDiff(anyString(), anyString(), anyString(), anyString()); }
@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); }