Skip to content
New issue

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

Enable assertions to be made on LoggingEvents from any thread. #207

Merged
merged 1 commit into from
Oct 18, 2021

Conversation

topbadger
Copy link

The current implementation only verifies against the LoggingEvents captured by the thread that is running the test. TestLogger provides access to all events captured across any thread via TestLogger::getAllLoggingEvents() so a modifying method has been added to the assertion class to allow the assertion mode to be switched.

Example usage:

assertThat(logger).anyThread().hasLogged(...);

The current implementation only verifies against the `LoggingEvent`s captured by the thread that is running the test. `TestLogger` provides access to all events captured across any thread via `TestLogger::getAllLoggingEvents()` so a modifying method has been added to the assertion class to allow the assertion mode to be switched.
@codeclimate
Copy link

codeclimate bot commented Oct 17, 2021

Code Climate has analyzed commit 97f0b56 and detected 0 issues on this pull request.

View more on Code Climate.

@valfirst valfirst merged commit 2be2665 into valfirst:master Oct 18, 2021
@topbadger topbadger deleted the thread-assertions branch October 18, 2021 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants