-
-
Notifications
You must be signed in to change notification settings - Fork 638
Add static keyword to wsBefore and wsAfter in ApiBuilder #2501
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: tipsy <[email protected]>
|
@copilot please remove the example, and find a much shorter way to test the api builder. Maybe just assert that the router had the appropriate routes? |
Co-authored-by: tipsy <[email protected]>
Done. Removed the example and simplified the test to just verify that the router has the appropriate routes registered. The test now checks that all 5 handlers (wsBefore with/without path, ws, wsAfter with/without path) are properly registered. (71b71ae) |
|
@copilot great, please verify the actual content though, not just the size. |
Co-authored-by: tipsy <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2501 +/- ##
============================================
+ Coverage 86.29% 86.48% +0.19%
- Complexity 1443 1447 +4
============================================
Files 151 151
Lines 4180 4180
Branches 477 477
============================================
+ Hits 3607 3615 +8
+ Misses 377 369 -8
Partials 196 196 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fix: Add
statickeyword towsBeforeandwsAftermethods in ApiBuilderIssue
Cannot use
wsBefore&wsAfterin ApiBuilder because the methods are missing thestatickeyword.Plan
statickeyword towsBeforeandwsAftermethods in ApiBuilder.javaChanges Made
ApiBuilder.java: Added
statickeyword to 4 methods:wsBefore(@NotNull String path, @NotNull Consumer<WsConfig> wsConfig)(line 402)wsBefore(@NotNull Consumer<WsConfig> wsConfig)(line 410)wsAfter(@NotNull String path, @NotNull Consumer<WsConfig> wsConfig)(line 418)wsAfter(@NotNull Consumer<WsConfig> wsConfig)(line 426)TestApiBuilderWebSocket.java: Created test that verifies:
Test Results
Root Cause
The
wsBeforeandwsAftermethods were missing thestaticmodifier, unlike other similar methods in ApiBuilder likews,before, andafter. This prevented them from being used in the static context of ApiBuilder.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.