This lesson describes how to configure a stub using Mockito. There are multiple ways of configuring stubs; in this lesson we describe two different ways and highlight when each method should be used.
- Creating a stub
- The difference between "when/then" and "do/when" stub configuration syntax
- Pros and cons of each style of configuration
- Configuring a stub to throw an Exception
- Stubbing a void method call
How to avoid triggering a CannotStubVoidMethodWithReturnValue exception