question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Verification is logged as invocation if verbose logging is enabled

See original GitHub issue

Hi,

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:open
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
SeriyBgcommented, Oct 21, 2019

Thanx for the help!

0reactions
SeriyBgcommented, Oct 22, 2019

@liptga I haven’t committed it as it doesn’t work. What I have tried is checking the verificationMode inside the MockitoCore#verify or VerboseMockInvocationLogger#reportInvocation. In both cases the verificationMode is null.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found