summaryrefslogtreecommitdiff
path: root/tests/plugins
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-16 15:21:56 +0300
committerValery Piashchynski <[email protected]>2021-06-16 15:21:56 +0300
commitb1aa5d0ea3617710aec6476bdae956e16b946281 (patch)
tree5b7c5259375d53b0685bf838555118d5ad93f149 /tests/plugins
parent8220151b6356488b8ef87fa52b14d2178a4e612d (diff)
- Update ws plugin responses (text instead of binary)
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests/plugins')
-rw-r--r--tests/plugins/websockets/websocket_plugin_test.go16
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)