lhotari commented on code in PR #17851:
URL: https://github.com/apache/pulsar/pull/17851#discussion_r981224614


##########
buildtools/src/main/java/org/apache/pulsar/tests/MockitoThreadLocalStateCleaner.java:
##########
@@ -72,16 +74,33 @@ public void cleanup() {
                         LOG.warn("Invalid usage of Mockito detected on thread 
{}."
                                         + " There is ongoing stubbing on mock 
of class={} instance={}",
                                 thread, mock.getClass().getName(), mock);
+                        try {
+                            clearInvocations(thread, mock);
+                        } catch (Exception e) {
+                            LOG.warn("Clearing invocations failed", e);
+                        }

Review Comment:
   This is not something that is used in developer written tests. The solution 
will log warnings when tests aren't doing the right thing. Tests should call 
`Mockito.reset` for mocks. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to