the service testing page in the Android documentation is indicated (highlighted by me):
Note. The ServiceTestRule class does not support testing IntentService Objects. If you need to test the IntentService object , you must encapsulate the logic in a separate class and create the corresponding unit test.
So the official answer seems to be "use unit test". However, outdated ServiceTestCase does not mean that you cannot continue to use it - only this is not recommended. If using an outdated interface is the only (or most effective) way to achieve your goal, you should continue to use it.
source share