added spy to unit test