Learn how to mock a method in the same test class, using Mockito Spy. The technique is especially useful for complex methods with multiple calls.
Also find me here:
Baeldung Author
Rim Ech-Chouqi
Hi, my name is Rim, I am a backend developper, with 7+ years of experience. Of which around 3 years working on java/spring boot environment. I also have some experience teaching technical topics in corporate environment (1 year). I love sharing knowledge and doing my best to explain complex topics in the clearest easiest way possible.
Here's what I've written (so far):
Baeldung on Java
- All
- Testing (2)
Mock Nested Method Calls Using Mockito
Filed under Testing
Learn how to mock nested method calls using Mockito stubs.