@Test public void updateDiffListWhenEmptyTest() throws NoSuchFieldException { new FieldSetter(presenter, SubmitChangeRequestScreenPresenter.class.getDeclaredField("workspaceProject")) .set(workspaceProject); doReturn(Collections.emptyList()).when(changeRequestService).getDiff(anyString(), anyString(), anyString(), anyString()); presenter.updateDiffContainer(); verify(view).clearDiffList(); verify(view, never()).addDiffItem(any(), any()); verify(changeRequestService).getDiff(anyString(), anyString(), anyString(), anyString()); verify(view).enableSubmitButton(false); }
public void updateDiffContainer() { busyIndicatorView.showBusyIndicator(ts.getTranslation(LibraryConstants.Loading)); changeRequestService.call((final List<ChangeRequestDiff> diffList) -> { boolean hideDiff = diffList.isEmpty(); if (hideDiff) { setupEmptyDiffList(); } else { setupPopulatedDiffList(diffList); } view.showDiff(!hideDiff); busyIndicatorView.hideBusyIndicator(); }, new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)) .getDiff(workspaceProject.getSpace().getName(), workspaceProject.getRepository().getAlias(), currentBranchName, selectedBranch); }
SubmitChangeRequestScreenPresenter { public void updateDiffContainer() { busyIndicatorView.showBusyIndicator(ts.getTranslation(LibraryConstants.Loading)); changeRequestService.call((final List<ChangeRequestDiff> diffList) -> { boolean hideDiff = diffList.isEmpty(); if (hideDiff) { setupEmptyDiffList(); } else { setupPopulatedDiffList(diffList); } view.showDiff(!hideDiff); busyIndicatorView.hideBusyIndicator(); }, new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)) .getDiff(workspaceProject.getSpace().getName(), workspaceProject.getRepository().getAlias(), currentBranchName, selectedBranch); } }
SubmitChangeRequestScreenPresenter { public void updateDiffContainer() { busyIndicatorView.showBusyIndicator(ts.getTranslation(LibraryConstants.Loading)); changeRequestService.call((final List<ChangeRequestDiff> diffList) -> { boolean hideDiff = diffList.isEmpty(); if (hideDiff) { setupEmptyDiffList(); } else { setupPopulatedDiffList(diffList); } view.showDiff(!hideDiff); busyIndicatorView.hideBusyIndicator(); }, new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)) .getDiff(workspaceProject.getSpace().getName(), workspaceProject.getRepository().getAlias(), currentBranchName, selectedBranch); } @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 updateDiffContainer() { busyIndicatorView.showBusyIndicator(ts.getTranslation(LibraryConstants.Loading)); changeRequestService.call((final List<ChangeRequestDiff> diffList) -> { boolean hideDiff = diffList.isEmpty(); if (hideDiff) { setupEmptyDiffList(); } else { setupPopulatedDiffList(diffList); } view.showDiff(!hideDiff); busyIndicatorView.hideBusyIndicator(); }, new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)) .getDiff(workspaceProject.getSpace().getName(), workspaceProject.getRepository().getAlias(), currentBranchName, selectedBranch); } @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 updateDiffContainer() { busyIndicatorView.showBusyIndicator(ts.getTranslation(LibraryConstants.Loading)); changeRequestService.call((final List<ChangeRequestDiff> diffList) -> { boolean hideDiff = diffList.isEmpty(); if (hideDiff) { setupEmptyDiffList(); } else { setupPopulatedDiffList(diffList); } view.showDiff(!hideDiff); busyIndicatorView.hideBusyIndicator(); }, new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)) .getDiff(workspaceProject.getSpace().getName(), workspaceProject.getRepository().getAlias(), currentBranchName, selectedBranch); } @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();  }