November 2024
Intermediate to advanced
300 pages
7h 12m
English
As an alternative to when(...).thenReturn(...), you might want to verify that a certain method was called with the proper arguments as part of processing. The typical case for this need is when you’re invoking a consumer—a method that has side effects but returns nothing. Mockito helps you verify that such a method was called with its verify functionality.
Update the AddressRetriever to tell an Auditor instance to add audit information when the country code returned is a non-U.S. country code:
| | public class AddressRetriever { |
| » | private Auditor auditor = new ApplicationAuditor(); |
| | // ... |
| | public Address retrieve( |
Read now
Unlock full access