#660: Add mocking to test