CC-5651: Unit Test the Scheduler

* More database connection stuff