We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With this sort of case
LogAssert expect = TestLoggers.sys().expect("org.spf4j.test", Level.WARN, LogMatchers.hasFormat("Booo")); LOG.warn("Booo", new RuntimeException()); // oops, lost the `assertObservation`!
the test will not fail if it does not produce the expected logs.
The @ExpectLog annotation avoids this hazard, but it is limited by the annotation requirement of only using compile-time values.
@ExpectLog
It'd be nice to have ways that make sure the assertion always runs and that still let you use matchers.
(Exactly how that looks probably depends on the test framework.)
The text was updated successfully, but these errors were encountered:
A static analysis tool like findbugs and spotbugs should highlight this.
(LogAssert uses: edu.umd.cs.findbugs.annotations.CleanupObligation; edu.umd.cs.findbugs.annotations.DischargesObligation)
however what you are suggesting is doable... let me think about it.
Sorry, something went wrong.
No branches or pull requests
With this sort of case
the test will not fail if it does not produce the expected logs.
The
@ExpectLog
annotation avoids this hazard, but it is limited by the annotation requirement of only using compile-time values.It'd be nice to have ways that make sure the assertion always runs and that still let you use matchers.
(Exactly how that looks probably depends on the test framework.)
The text was updated successfully, but these errors were encountered: