Improved test mock