Relative Content

Tag Archive for javaunit-testingmockitojunit5

How can you track down a unclosed static mock?

Suppose I have two classes, MyObject1 and MyObject2, both of which use Mockito to declare a static mock MyStaticObject. Suppose MyObject1 forgets to close MyStaticObject causing MyObject2 test cases to fail with the following exception: