@Before public void setup() { ((TestApplicationComponent) RacquetApplication.getApplication().getApplicationComponent()) .inject(this); Club club = ModelBuilder.getClub(1, "My Club"); Intent intent = ClubActivity.getIntent(RuntimeEnvironment.application, club); ActivityController<ClubActivity> activityController = ActivityController.of(Robolectric.getShadowsAdapter(), ClubActivity.class); activity = activityController.withIntent(intent).setup().get(); }
public static <F extends Fragment> SupportFragmentController<F> of( F fragment, Class<? extends FragmentActivity> activityClass) { return new SupportFragmentController<>( Robolectric.getShadowsAdapter(), fragment, activityClass); }