Add config injection hook for testing.
Add test case.