You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/02/25 22:45:03 UTC

[GitHub] [geode] demery-pivotal commented on pull request #7395: GEODE-10084: CliFunction should handle all throwable

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-unsubscribe@geode.apache.org

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