Browse Source

修改单元测试文件

master
guzeng 1 year ago
parent
commit
696335381a
2 changed files with 26 additions and 3 deletions
  1. +1
    -3
      client_test.go
  2. +25
    -0
      send_delay_test.go

+ 1
- 3
client_test.go View File

@ -1,7 +1,6 @@
package rabbitmqrpc
import (
"encoding/json"
"testing"
)
@ -18,9 +17,8 @@ func Test_Send(t *testing.T) {
"order_sn": "cccc",
},
}
data, _ := json.Marshal(msg)
ret, err := Send(exchange, key, string(data))
ret, err := Send(exchange, key, msg)
t.Log(ret)
t.Log(err)


+ 25
- 0
send_delay_test.go View File

@ -0,0 +1,25 @@
package rabbitmqrpc
import (
"testing"
)
func Test_SendDelay(t *testing.T) {
exchange := "ex_order_delay"
key := "order_expire"
msg := map[string]interface{}{
"site_id": "100002",
"dbname": "testing",
"data": map[string]string{
"order_id": "111",
"order_sn": "cccc",
},
}
ret, err := SendDelay(exchange, key, msg, 20)
t.Log(ret)
t.Log(err)
}

Loading…
Cancel
Save