MainActivity extends SpotifyAbstractActivity { protected ProgressDialog initProgressDialog(Context context) { ProgressDialog progressDialog = new ProgressDialog(context); progressDialog.setMessage(context.getString(R.string.loading)); progressDialog.setIndeterminate(true); return progressDialog; }  @Override void onCreate(Bundle savedInstanceState); @Override void onStart(); void waitForAuthToken(); SpotifyHelper getSpotifyHelper();  }
@Test public void test_initProgressDialog() { Activity activity = Robolectric.buildActivity(Activity.class).create().get(); ProgressDialog dialog = ((MainActivity) getActivity()).initProgressDialog(activity); assertNotNull(dialog); assertTrue(dialog.isIndeterminate()); }