I'm trying to test the onHandleIntent() method of an IntentService using Robolectric.
I'm starting the service with:
Activity activity = new Activity();
Intent intent = new Intent(activity, MyService.class);
activity.startService(intent);
ShadowActivity shadowActivity = Robolectric.shadowOf(activity);
Intent startedIntent = shadowActivity.getNextStartedService();
assertNotNull(startedIntent);
seems like startedIntent is not null, but onHandleIntent() doesn't seem to be called.
how should I test it ?