MainActivityPresenter extends BasePresenter { public void onSearchButtonClicked(String city) { if (!TextUtils.isEmpty(city)) { WeatherSpecification specification = new WeatherSpecification(); specification.setCityName(city); Bundle bundle = new Bundle(); bundle.putSerializable(WeatherSpecification.ARG_WEATHER_SPECIFICATION, specification); mModel.onStartModelUpdate(0, MainActivityViewModel.QueryEnumMainActivity.UPDATE_WEATHER, bundle); mDisplayView.showProgressBar(); } } MainActivityPresenter(int presenterId, DisplayView displayView, ViewModel viewModel); @Override void loadInitialData(Bundle args, boolean isConfigurationChange); @Override void onUpdateComplete(RequestResult requestResult, ViewModel.QueryEnum query); void onSearchButtonClicked(String city);  }
@Test public void testOnSearchButtonClicked() throws Exception { mPresenter.onSearchButtonClicked("Sydney"); verify(mHomepageCallbacks).showProgressBar(); }