-
Notifications
You must be signed in to change notification settings - Fork 208
Update Logback smoke tests to use new assertion framework #4326
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
Conversation
Co-authored-by: trask <[email protected]>
Co-authored-by: trask <[email protected]>
|
@copilot preserve existing comments where possible |
Co-authored-by: trask <[email protected]>
Added the missing comments back to both |
This PR updates the Logback smoke tests to use the new assertion framework introduced in #4141, making the tests more readable and maintainable while keeping changes minimal.
Changes Made
Framework Extensions
MessageAssertclass: Provides fluent assertions forMessageDatawith methods likehasMessage(),hasSeverityLevel(),hasProperty(), etc.ExceptionAssertclass: Provides fluent assertions forExceptionDatawith methods likehasExceptionType(),hasExceptionMessage(),hasSeverityLevel(), etc.TraceAssertclass: Added support for message and exception assertions withhasMessageSatisfying(),hasExceptionSatisfying(),hasMessageCount(),hasExceptionCount()methods.Test Updates
All Logback smoke tests have been converted from manual envelope parsing to the new fluent assertion API:
LogbackTest.java: Converted complex manual assertions to cleantesting.waitAndAssertTrace()callsLogbackDisabledTest.java: Simplified assertions for disabled logging behavior validationLogbackLevelOffTest.java: Updated to use new assertion framework for level-off configuration testingBefore/After Comparison
Before (old manual approach):
After (new fluent API):
Benefits
Testing
LogbackTest,LogbackDisabledTest,LogbackLevelOffTest)./gradlew spotlessApplyThe assertion framework extensions (
MessageAssert,ExceptionAssert) can be reused by other smoke tests that need to validate message and exception data.💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.