Router { public void launchCreateDeckFlow(Activity activity, NewDeckContext newDeckContext) { Intent createIntent = new Intent(activity, GetStartedDeckActivity.class); createIntent.putExtra(AddDeckActivity.INTENT_KEY_DECK, newDeckContext); activity.startActivityForResult(createIntent, Router.REQUEST_CODE_CREATE_DECK); }  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 shouldLaunchCreateDeckFlow() { Activity activity = mock(Activity.class); NewDeckContext newDeckContext = mock(NewDeckContext.class); router.launchCreateDeckFlow(activity, newDeckContext); ArgumentCaptor<Intent> argument = ArgumentCaptor.forClass(Intent.class); verify(activity).startActivityForResult(argument.capture(), eq(Router.REQUEST_CODE_CREATE_DECK)); assertEquals(newDeckContext, argument.getValue().getParcelableExtra(AddDeckActivity.INTENT_KEY_DECK)); }