You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should we update such usages to pass on the Exception and append it to the log of the reporter? That could potentially help Mockito users finding the root-cause.
The text was updated successfully, but these errors were encountered:
Mockito should better avoid exception where possible rather than abusing them for control flow. In case of your example in MockitoCore.verifyNoMoreInteractions the exception can be avoided by calling MockUtil.isMock(..) before, this makes the intent clear.
Small note by me: I tried to extract the list, but haven't been succesful just yet. If anyone knows how to extract a list from SonarQube, that would be greatly appreciated. I haven't found an option to do so just yet 😭
I ran SonarQube on the project and it reported numerous issues with the following description:
Either log or rethrow this exception.
An concrete example is https://github.com/mockito/mockito/blob/release/2.x/src/main/java/org/mockito/internal/MockitoCore.java#L126 which shows that the Exception is caught, but not passed into the
Reporter.notAMockPassedToVerifyNoMoreInteractions
.Should we update such usages to pass on the Exception and append it to the log of the reporter? That could potentially help Mockito users finding the root-cause.
The text was updated successfully, but these errors were encountered: