Router { public void launchImportActivityForResult(Activity activity, Uri data) { Intent intent = new Intent(activity, ImportActivity.class); intent.setData(data); activity.startActivityForResult(intent, REQUEST_CODE_IMPORT_FILE); }  void launchFeedbackActivity(Activity activity); void launchImportActivityForResult(Activity activity, Uri data); void launchCreateDeckFlow(Activity activity, NewDeckContext newDeckContext); void launchFilePicker(Activity activity); static final int REQUEST_CODE_IMPORT_FILE_PICKER; static final int REQUEST_CODE_IMPORT_FILE; static final int REQUEST_CODE_CREATE_DECK; }
@Test public void shouldLaunchImportActivity() { Uri data = mock(Uri.class); Activity activity = mock(Activity.class); router.launchImportActivityForResult(activity, data); ArgumentCaptor<Intent> argument = ArgumentCaptor.forClass(Intent.class); verify(activity).startActivityForResult(argument.capture(), eq(Router.REQUEST_CODE_IMPORT_FILE)); assertEquals(data, argument.getValue().getData()); }