In a generated test i found a mocked method, which should throw an IllegalStateException (red line). The method getAbholerNr()
is a simple getter for a field - it does not throw any exception by itself, there is no interface in between declaring a thrown exception.
The call loadAllKontingente()
(blue line) throws the IllegalStateException only because of the synthetic mocked exception in getAbholer() .thenThrow().
The question is: why and how does Diffblue create this exception on an innocent mocked method (getAbholerNr()
)?
These show up (rarely) in other tests with other methods in other classes - but i’d say, most of them are simple getters too, without any chance to throw any exception.
This superfluous test is not a big problem - but maybe Diffblue wanted to tell us something different?