Mock the Factory in the tests.