quarkus-quickstarts
quarkus-quickstarts copied to clipboard
Fix join message in websocket quickstart
There should be a "joined" message on user joining, but no message is acctually sent.
No "ready" message is generated on user joining, so move this message to user incoming.
Relates to https://github.com/quarkusio/quarkus/pull/35061
Check list:
Your pull request:
- [x] targets the
development
branch - [x] uses the
999-SNAPSHOT
version of Quarkus - [ ] has tests (
mvn clean test
) - [ ] works in native (
mvn clean package -Pnative
) - [ ] has integration/native tests (
mvn clean verify -Pnative
) - [ ] makes sure the associated guide must not be updated
- [x] links the guide update pull request (if needed)
- [ ] updates or creates the
README.md
file (with build and run instructions) - [ ] for new quickstart, is located in the directory component-quickstart
- [ ] for new quickstart, is added to the root
pom.xml
andREADME.md
:waning_crescent_moon: This workflow status is outdated as a new workflow run has been triggered.
Failing Jobs - Building a3f84126ef08a3bf4fb20c92517f79455dd49feb
Status | Name | Step | Failures | Logs | Raw logs |
---|---|---|---|---|---|
✖ | Build - JDK 11 | Build with Maven |
Failures | Logs | Raw logs |
Full information is available in the Build summary check run.
Failures
:gear: Build - JDK 11 #
- Failing: websockets-quickstart
:package: websockets-quickstart
✖ org.acme.websockets.ChatTest.testWebsocketChat
line 31
- More details - Source on GitHub
org.opentest4j.AssertionFailedError: expected: <User stu joined> but was: <>> stu: _ready_>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
@mocenas actually, it looks like your assumptions were incorrect? Could you get to the bottom of it?
I think this is related to the test here: https://github.com/quarkusio/quarkus-quickstarts/blob/main/websockets-quickstart/src/test/java/org/acme/websockets/ChatTest.java#L45
I see we have another fix proposal here: https://github.com/quarkusio/quarkus-quickstarts/pull/1305/files
@gsmet Code changes were probably OK, only that tests relied on the old behaviour (it actually seems that entire "ready" message was there just for test purposes). I changed the tests to work with new behaviour.
Comparing this PR to #1305 this one is more complex, but gets rid of the "ready" message entirely. Which also means that the ready message will not pop up in the chat.
:heavy_check_mark: The latest workflow run for the pull request has completed successfully.
It should be safe to merge provided you have a look at the other checks in the summary.