Used TestScheduler to fix the unit test