Every single test succeeded. Thought to run the class for testing. But failed with the error unnecessarystubbingexception class
Validating a method using when and thenReturn of mockito.
Every single test succeeded. Thought to run the class for testing. But failed with the error unnecessarystubbingexception class
Validating a method using when and thenReturn of mockito.
This error occurs when you create a Mock that is never called upon. It is dead code and can be removed. Without providing your Code it is however not possible to tell which of your stubbing is never called ;)