I just refactored many parts of code by simplifying things. Now I need to refactor the tests as well to make them green again, which is not that hard.
But now I struggle a bit as I saw that I don't need some of my .when() declarations anymore as these Mocks won't be called anymore. The thing is they don't make my test red, so I can only identify them by carefully going through each test and compare it to the code, which is kind of annoying and lead to letting it be like that.
Is there any possibilty to make unused .when()'s throwing an error or such? Like a verify which never happens? It would be enough to do it like in setUp: Mockito.enableDebugMode() or whatever, maybe there is such a possibility? ..
Best