github.com/infraboard/keyauth@v0.8.1/apps/system/notify/sms/tencent_test.go (about) 1 package sms_test 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 8 "github.com/infraboard/keyauth/apps/system/notify" 9 "github.com/infraboard/keyauth/apps/system/notify/sms" 10 ) 11 12 func TestSendMail(t *testing.T) { 13 should := assert.New(t) 14 conf, err := sms.LoadConfigFromEnv() 15 if should.NoError(err) { 16 sd, err := sms.NewSender(conf) 17 if should.NoError(err) { 18 req := notify.NewSendSMSRequest() 19 req.TemplateID = conf.Tencent.TemplateID 20 req.ParamSet = []string{"409933", "10"} 21 req.PhoneNumberSet = []string{"+8618108053819"} 22 should.NoError(sd.Send(req)) 23 } 24 } 25 }