Mockito UnfinishedStubbingException in tests
Ever wonder why Mockito will occasionally give you an UnfinishedStubbingException
even though you clearly finished the stubbing?
For example, the following code will fail at runtime (mockChannel
has been setup earlier):
1 2 |
|
With an exception like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
This is a very good exception message. It gives you some common examples of what you might have done wrong, and how to fix them. However, our code doesn’t match any of the examples.
Read on →