Browse Source
The server accepts the WebSocket handshake and closes the session right away when it rejects a pre-verification token in afterConnectionEstablished. Java-WebSocket's connectBlocking() releases its latch on both open and close and then returns engine.isOpen(), so it returns false when the client reads the close frame before the caller checks the state. The asserted connect in buildAndConnectWebSocketClient then failed. The test now connects without asserting the connect result, waits for the close, and asserts the server close code (1011), so it still proves the token was rejected.pull/16352/head
3 changed files with 15 additions and 2 deletions
Loading…
Reference in new issue