PhotoUploadBox extends BaseView implements RapidFtrActivity.ResultListener { public void startCapture() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoCaptureHelper.getTempCaptureFile())); RapidFtrActivity context = (RapidFtrActivity) getContext(); photoCaptureHelper.setCaptureTime(); context.startActivityForResult(intent, CAPTURE_IMAGE_REQUEST); } PhotoUploadBox(Context context);  PhotoUploadBox(Context context, AttributeSet attrs); @Override void onActivityResult(int requestCode, int resultCode, Intent data); @Override void setEnabled(boolean isEnabled); View getImageContainer(); void onImageClick(); void startCapture(); void saveCapture(); void repaint(); static final int CAPTURE_IMAGE_REQUEST; static final int SHOW_FULL_IMAGE_REQUEST; static final String PHOTO_KEYS; static final String CURRENT_PHOTO_KEY; }
@Test public void shouldSetCaptureTimeWhenStartCapture() throws Exception { doCallRealMethod().when(photoCaptureHelper).getTempCaptureFile(); view.startCapture(); verify(photoCaptureHelper).setCaptureTime(); }