FetchPresenter implements FetchView.ActionDelegate { @Override public void onValueChanged() { boolean isFetchAll = view.isFetchAllBranches(); view.setEnableLocalBranchField(!isFetchAll); view.setEnableRemoteBranchField(!isFetchAll); } @Inject  FetchPresenter(DtoFactory dtoFactory,
                          FetchView view,
                          GitOutputPartPresenter console,
                          GitServiceClient service,
                          AppContext appContext,
                          GitLocalizationConstant constant,
                          NotificationManager notificationManager,
                          DtoUnmarshallerFactory dtoUnmarshallerFactory,
                          BranchSearcher branchSearcher); void showDialog(); @Override void onFetchClicked(); @Override void onCancelClicked(); @Override void onValueChanged(); @Override void onRemoteBranchChanged(); @Override void onRemoteRepositoryChanged();  }
@Test public void testOnValueChanged() throws Exception { when(view.isFetchAllBranches()).thenReturn(FETCH_ALL_BRANCHES); presenter.onValueChanged(); verify(view).setEnableLocalBranchField(eq(DISABLE_FIELD)); verify(view).setEnableRemoteBranchField(eq(DISABLE_FIELD)); when(view.isFetchAllBranches()).thenReturn(!FETCH_ALL_BRANCHES); presenter.onValueChanged(); verify(view).setEnableLocalBranchField(eq(ENABLE_FIELD)); verify(view).setEnableRemoteBranchField(eq(ENABLE_FIELD)); }