CitiesFallbackActivity extends NavigationDrawerActivity implements CitiesFallbackAdapter.OnCitySelectedListener { @Override public void onCitySelected(City city) { Timber.d("City selected"); mPrefs.setFavoriteCity(city); startActivity(BaggersListActivity.createLaunchIntent(this, city)); }  @Override void onCitySelected(City city);  }
@Test public void should_start_baggers_list_activity_when_city_is_selected() { City city = new City(); city.name = "Paris"; city.lat = 42d; city.lng = 1d; activity.onCitySelected(city); ShadowActivity shadowActivity = Shadows.shadowOf(activity); Intent intent = shadowActivity.getNextStartedActivity(); assertThat(intent.getComponent().getClassName()).isEqualTo(BaggersListActivity.class.getName()); assertThat(((City) intent.getParcelableExtra("mCity")).name).isEqualTo("Paris"); }