demery-pivotal commented on pull request #7395:
URL: https://github.com/apache/geode/pull/7395#issuecomment-1051331522


   > I thought the purpose of spy or mock is to reduce the need for test 
classes.
   
   The purpose of mocks (and, in _very rare_ cases, spies) is to make it easier 
for the test to control and observe the _collaborators_ of the thing you're 
testing.
   
   It's true that code I offered does create some noise. To make it more 
readable, move the noise into a helper method, and name the helper method to 
make its purpose in the test clear. So the body could do something like this:
   ```
   function = cliFunctionThatThrows(theError);
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to