Repository navigation
Conversation
…unregister rules Extend FilterSpiTest: duplicate type registration throws and keeps the original filter, unregister returns the filter and allows re-register, and a duplicate SQL92 built-in registration is rejected without disturbing the built-in filter.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11349 +/- ##
=============================================
- Coverage 49.75% 49.73% -0.03%
- Complexity 14354 14365 +11
=============================================
Files 1390 1390
Lines 103246 103262 +16
Branches 13502 13504 +2
=============================================
- Hits 51375 51354 -21
- Misses 45679 45710 +31
- Partials 6192 6198 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Extends FilterSpiTest with coverage of FilterFactory duplicate-registration rejection and unregister rules.
Findings
- [Info]
FilterSpiTest.java:84-148— Three well-structured tests: duplicate type rejection (original survives), unregister-then-reregister, and built-in SQL92 protection. The try/finally cleanup ensures test isolation. - [Info] The
AnotherNothingFilterstub correctly provides a second implementation of the same type to verify the rejection path.
Suggestions
- None. Clean test additions that fill a real coverage gap.
Automated review by github-manager-bot
d23627a to
56bba01
Compare
|
Hi @RongtongJin, sorry for the ping — this PR has been open for a while without a review yet. The change is small and focused (cover FilterFactory duplicate and unregister rules), and all tests and CI pass on my side. Would you mind taking a look when you get a chance? If it looks good, merging it would be much appreciated — happy to adjust anything if needed. Thanks a lot! |
Which Issue(s) This PR Fixes
Fixes #11340
Brief Description
Extends the existing
FilterSpiTestwith coverage of theFilterFactoryregistration rules that protect the broker's filter registry:IllegalArgumentExceptionand the original instance survives (no silent overwrite of e.g. the built-in SQL92 filter);unRegisterreturns the removed filter, makesgetreturn null, and the type becomes registerable again;SQL92filter is rejected and leaves the built-in filter functional.Each test cleans the registry in
finallyso the shared factory is left as found. Test-only change; no production code touched.How Did You Test This Change?
mvn -pl filter -Dtest=FilterSpiTest -Dsurefire.failIfNoSpecifiedTests=false test(JDK 11, PR base commit):Tests run: 5, Failures: 0, Errors: 0(2 pre-existing + 3 new).