Verification is logged as invocation if verbose logging is enabled
See original GitHub issueHi,
First of all thanks for your great work. During debugging my test I noticed a possible bug.
Consider the following test using Mockito 3.1.0 version (along with JUnit 5.4.2 and Assertj 3.11.1):
public class InteractionCountBugTest {
@Test
public void verboseLoggingShouldNotLogVerifications() {
@SuppressWarnings("unchecked")
List<String> list = mock(List.class, withSettings().verboseLogging());
list.size(); // <- this invocation is printed (OK)
verify(list).size(); // <- this invocation is printed (not OK)
}
}
The test fails, since 4 invocations were logged instead of 2.
What do you think?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
In log4j, does checking isDebugEnabled before logging ...
In the given example, the log message is a constant string, so letting the logger discard it is just as efficient as checking...
Read more >Configure monitoring for Azure Functions - Microsoft Learn
Learn how to connect your function app to Application Insights for monitoring and how to configure data collection.
Read more >Enable Logging for Spring Security - Baeldung
Configure Spring Security Logging This way, we can check out logs about the Authentication or the Filter Chain. Moreover, we can even use...
Read more >Greater Visibility Through PowerShell Logging - Mandiant
Figure 1 shows an example of the event log messages recorded in the ... upgrading PowerShell to enable enhanced logging in PowerShell 5.0 ......
Read more >Enable flow logs - Amazon Connect - AWS Documentation
How to enable flow logging at the instance level and flow level. ... or parts of flows, logs are generated for by including...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanx for the help!
@liptga I haven’t committed it as it doesn’t work. What I have tried is checking the
verificationMode
inside theMockitoCore#verify
orVerboseMockInvocationLogger#reportInvocation
. In both cases theverificationMode
isnull
.