Added the ability to set the ID on a handler if the context is unit test.