Add TestHook method instead of constructor injection