Modify test to introduce a test spy