Use spyOn instead of overriding method.