diff options
author | Valery Piashchynski <[email protected]> | 2021-06-16 15:21:56 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-06-16 15:21:56 +0300 |
commit | b1aa5d0ea3617710aec6476bdae956e16b946281 (patch) | |
tree | 5b7c5259375d53b0685bf838555118d5ad93f149 /tests/plugins/websockets | |
parent | 8220151b6356488b8ef87fa52b14d2178a4e612d (diff) |
- Update ws plugin responses (text instead of binary)
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests/plugins/websockets')
-rw-r--r-- | tests/plugins/websockets/websocket_plugin_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/plugins/websockets/websocket_plugin_test.go b/tests/plugins/websockets/websocket_plugin_test.go index 07ee5f12..8321297d 100644 --- a/tests/plugins/websockets/websocket_plugin_test.go +++ b/tests/plugins/websockets/websocket_plugin_test.go @@ -356,7 +356,7 @@ func RPCWsMemoryPubAsync(t *testing.T) { _, msg, err = c.ReadMessage() retMsg = utils.AsString(msg) assert.NoError(t, err) - assert.Equal(t, "hello, PHP", retMsg) + assert.Equal(t, "{\"topic\":\"foo\",\"payload\":\"hello, PHP\"}", retMsg) // //// LEAVE foo, foo2 ///////// d, err = json.Marshal(messageWS("leave", "memory", []byte("hello websockets"), "foo")) @@ -386,7 +386,7 @@ func RPCWsMemoryPubAsync(t *testing.T) { _, msg, err = c.ReadMessage() retMsg = utils.AsString(msg) assert.NoError(t, err) - assert.Equal(t, "hello, PHP2", retMsg) + assert.Equal(t, "{\"topic\":\"foo2\",\"payload\":\"hello, PHP2\"}", retMsg) err = c.WriteControl(websocket.CloseMessage, nil, time.Time{}) assert.NoError(t, err) @@ -430,7 +430,7 @@ func RPCWsMemory(t *testing.T) { _, msg, err = c.ReadMessage() retMsg = utils.AsString(msg) assert.NoError(t, err) - assert.Equal(t, "hello, PHP", retMsg) + assert.Equal(t, "{\"topic\":\"foo\",\"payload\":\"hello, PHP\"}", retMsg) // //// LEAVE foo, foo2 ///////// d, err = json.Marshal(messageWS("leave", "memory", []byte("hello websockets"), "foo")) @@ -460,7 +460,7 @@ func RPCWsMemory(t *testing.T) { _, msg, err = c.ReadMessage() retMsg = utils.AsString(msg) assert.NoError(t, err) - assert.Equal(t, "hello, PHP2", retMsg) + assert.Equal(t, "{\"topic\":\"foo2\",\"payload\":\"hello, PHP2\"}", retMsg) err = c.WriteControl(websocket.CloseMessage, nil, time.Time{}) assert.NoError(t, err) @@ -502,7 +502,7 @@ func RPCWsRedis(t *testing.T) { _, msg, err = c.ReadMessage() retMsg = utils.AsString(msg) assert.NoError(t, err) - assert.Equal(t, "hello, PHP", retMsg) + assert.Equal(t, "{\"topic\":\"foo\",\"payload\":\"hello, PHP\"}", retMsg) // //// LEAVE foo, foo2 ///////// d, err = json.Marshal(messageWS("leave", "redis", []byte("hello websockets"), "foo")) @@ -532,7 +532,7 @@ func RPCWsRedis(t *testing.T) { _, msg, err = c.ReadMessage() retMsg = utils.AsString(msg) assert.NoError(t, err) - assert.Equal(t, "hello, PHP2", retMsg) + assert.Equal(t, "{\"topic\":\"foo2\",\"payload\":\"hello, PHP2\"}", retMsg) err = c.WriteControl(websocket.CloseMessage, nil, time.Time{}) assert.NoError(t, err) @@ -873,7 +873,7 @@ func RPCWsMemoryAllow(t *testing.T) { _, msg, err = c.ReadMessage() retMsg = utils.AsString(msg) assert.NoError(t, err) - assert.Equal(t, "hello, PHP", retMsg) + assert.Equal(t, "{\"topic\":\"foo\",\"payload\":\"hello, PHP\"}", retMsg) // //// LEAVE foo, foo2 ///////// d, err = json.Marshal(messageWS("leave", "memory", []byte("hello websockets"), "foo")) @@ -903,7 +903,7 @@ func RPCWsMemoryAllow(t *testing.T) { _, msg, err = c.ReadMessage() retMsg = utils.AsString(msg) assert.NoError(t, err) - assert.Equal(t, "hello, PHP2", retMsg) + assert.Equal(t, "{\"topic\":\"foo2\",\"payload\":\"hello, PHP2\"}", retMsg) err = c.WriteControl(websocket.CloseMessage, nil, time.Time{}) assert.NoError(t, err) |