#660: Add mocking to test

Submitting a new Pull Request for #660 

Please let me know if it's OK.  Thanks.