test: add test coverage for EchoWebSocket#1998
test: add test coverage for EchoWebSocket#1998Harsh16gupta wants to merge 3 commits intoasyncapi:masterfrom
Conversation
|
What reviewer looks at during PR reviewThe following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.
|
📝 WalkthroughWalkthroughAdds an integration test suite for the EchoWebSocket component and a test fixture update that introduces an explicit WebSocket pathname. The tests parse an AsyncAPI fixture and run three snapshot-based render scenarios for different Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| channels = parsedAsyncAPIDocument.channels(); | ||
| queryParams = getQueryParams(channels); | ||
| operations = parsedAsyncAPIDocument.operations(); | ||
| title = parsedAsyncAPIDocument.info().title(); |
There was a problem hiding this comment.
you can directly just use helper getTitle()
| title = parsedAsyncAPIDocument.info().title(); | ||
| const channel = channels.all()[0]; | ||
| pathName = channel.address(); | ||
| }); |
There was a problem hiding this comment.
but in the templates where the component is used https://github.com/asyncapi/generator/blob/master/packages/templates/clients/websocket/java/quarkus/template/src/main/java/com/asyncapi/client.java.js
the pathname is of server, why are you taking address of channel?
There was a problem hiding this comment.
My bad, the fixture did not have a pathname in the server. Will update the fixture and then make the changes.
Current fixture (missing pathname):
asyncapi: 3.0.0
info:
title: WebSocket Components Test Fixture
version: 1.0.0
description: AsyncAPI document used as a test fixture for WebSocket client components.
servers:
testServer:
host: test.example.com
protocol: wss
description: Test WebSocket server
Will add pathname: /ws
|



Description
Adds comprehensive integration tests for the
EchoWebSocketcomponent in the Java Quarkus WebSocket client template.Related Issue
Fixes #1933
Summary by CodeRabbit