CC-5651: Unit Test the Scheduler

Moved common database setup functions to helper class