(t *testing.T)
| 528 | } |
| 529 | |
| 530 | func TestWebSocketRequestCorrelation(t *testing.T) { |
| 531 | ensureServer() |
| 532 | token := signUpAndGetToken(t) |
| 533 | |
| 534 | ws := dialWS(t, token) |
| 535 | defer ws.Close() |
| 536 | |
| 537 | // send with id — response should echo id |
| 538 | id := nextReqId() |
| 539 | sendJSON(t, ws, wsPayload{Id: id, Method: "subscribe", Payload: map[string]interface{}{"topicName": "user_account"}}) |
| 540 | msg := recvJSON(t, ws, 5*time.Second) |
| 541 | if msg.Id != id { |
| 542 | t.Errorf("expected id=%q echoed, got %q", id, msg.Id) |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | func TestWebSocketNoIdOmitted(t *testing.T) { |
| 547 | ensureServer() |
nothing calls this directly
no test coverage detected