RegisterChildActivity extends BaseChildActivity { protected void initializeView() { setContentView(R.layout.activity_register_child); findViewById(R.id.submit).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { saveChild(); } }); }  @Override void onBackPressed();  }
@Test public void testSaveListener() throws JSONException { doReturn(null).when(activity).save(); activity.initializeView(); activity.findViewById(R.id.submit).performClick(); verify(activity).save(); }