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
Mockito has a local copy of @CheckReturnValue (presumably to avoid a dependency on errorprone, but it's only used on a few APIs. There's a lot of additional APIs that it could be applied to, an in fact the best solution is often to annotate entire classes (and then opt-out specific APIs) or entire packages (via package-info.java).
Top APIs to add @CheckReturnValue to:
org.mockito.ArgumentMatchers
org.mockito.ArgumentCaptor
org.mockito.Mockito
org.mockito.stubbing.Stubber
The text was updated successfully, but these errors were encountered:
Just to double-check that I understand the behavior of @CheckReturnValue. If we were to add it to org.mockito.Mockito, it can automatically ignore any method that returns void?
Indeed, it only affects non-void methods. Additionally, it's often easier to add it to the class, and if there are methods where it is OK to ignore the return value, then those methods would be marked with @CanIgnoreReturnValue.
Mockito has a local copy of
@CheckReturnValue
(presumably to avoid a dependency on errorprone, but it's only used on a few APIs. There's a lot of additional APIs that it could be applied to, an in fact the best solution is often to annotate entire classes (and then opt-out specific APIs) or entire packages (viapackage-info.java
).Top APIs to add
@CheckReturnValue
to:org.mockito.ArgumentMatchers
org.mockito.ArgumentCaptor
org.mockito.Mockito
org.mockito.stubbing.Stubber
The text was updated successfully, but these errors were encountered: