Test helper for creating objects with dependencies that need to be mocked.