CitiesMapActivity extends BaseMapActivity { public static Intent createLaunchIntent(@NonNull Context context, boolean withNavigationDrawer) { Intent intent = new Intent(context, NetworkUtils.isNetworkAvailable(context) && AppUtils.hasGooglePlayServices(context) && AppUtils.isGeolocAllowed(context) ? CitiesMapActivity.class : CitiesFallbackActivity.class); intent.putExtra(EXTRA_DISABLE_DRAWER, !withNavigationDrawer); return intent; }  static Intent createLaunchIntent(@NonNull Context context, boolean withNavigationDrawer);  }
@Test public void should_create_launch_intent_with_disabled_drawer_when_specified() { boolean enableDrawer = false; Intent intent = CitiesMapActivity.createLaunchIntent(RuntimeEnvironment.application, enableDrawer); assertThat(intent.getComponent().getClassName()).isEqualTo(CitiesFallbackActivity.class.getName()); assertThat(intent.getBooleanExtra("mDisableDrawer", false)).isTrue(); }
@Test public void should_create_launch_intent_with_enabled_drawer_when_specified() { boolean enableDrawer = true; Intent intent = CitiesMapActivity.createLaunchIntent(RuntimeEnvironment.application, enableDrawer); assertThat(intent.getComponent().getClassName()).isEqualTo(CitiesFallbackActivity.class.getName()); assertThat(intent.getBooleanExtra("mDisableDrawer", true)).isFalse(); }