[Mockito] Mocking void methods to set a passed in parameter

Consider the following badly designed code:

 

This is being used as below:

How can I test this method with Mockito? Look at the following snippet:

The code can be found here: https://github.com/paawak/blog/tree/master/code/MockitoExample

Leave a Reply

Your email address will not be published. Required fields are marked *