Skip to content

How can I test a websocket next ? #45287

Answered by mkouba
cvgaviao asked this question in Q&A
Dec 24, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

@cvgaviao You can use any WebSocket client to test your endpoint. In the example linked above we use the Vert.x WebSocket client and you can use it too in your @QuarkusTest (there's no need to use the QuarkusUnitTest).

Another alternative is to use a WebSocket Next client endpoint located in the src/test/java so that it's not part of the production app; something along the lines of https://github.com/quarkusio/quarkus/blob/c3ccc1319270bf9f4659d858fce5343efcd82450/extensions/websockets-next/deployment/src/test/java/io/quarkus/websockets/next/test/client/ClientAutoPingIntervalTest.java.

There's also an integration test for WS Next. And again, it's using the WebSocketClient from Vert.x.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mkouba
Comment options

mkouba Jan 10, 2025
Collaborator

Answer selected by cvgaviao
@cvgaviao
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants