-
I'm creating a websocket for a use case where it seems that I just need to use the @onopen, to keep a stream being fulfilled at some ticket time, but I don't know to create a test for it. There is nothing here related to websocket test here: https://quarkus.io/guides/websockets-next-tutorial I've dug some test examples and found an interesting one here. But we can't use QuarkusUnitTest since its internal.
Could someone point me to some example ? thanks |
Beta Was this translation helpful? Give feedback.
Answered by
mkouba
Jan 10, 2025
Replies: 1 comment 2 replies
-
\CC @mkouba |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@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 theQuarkusUnitTest
).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.