package firenzeapi import ( "service/api/errcode" firenzeproto "service/api/proto/firenze" "service/bizcommon/util" "service/library/melody" "testing" ) func TestSendBizMsg(t *testing.T) { param := &firenzeproto.SendBizMsgParam{ Mid: 111, } msg := melody.BizMsg{ Type: firenzeproto.MsgTypeSysNotifyTab, Data: map[string]any{ "unread_cnt": 10, }, } param.Msg = util.MustMarshal(msg) resp, err := SendBizMsg(param) if err != nil { t.Logf("SendBizMsg fail, resp: %v, err: %v", util.ToJson(resp), err) return } if resp.ErrCode != errcode.ErrCodeOk { t.Logf("SendBizMsg fail, invalid resp, resp: %v, err: %v", util.ToJson(resp), err) return } t.Logf("SendBizMsg success, resp: %v", util.ToJson(resp)) }