You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

47 lines
985 B

package service
import (
"testing"
"go-common/app/job/main/passport-auth/model"
. "github.com/smartystreets/goconvey/convey"
)
func Test_HandleToken(t *testing.T) {
once.Do(startService)
Convey("Test del cookie by cookie", t, func() {
token := &tokenBMsg{
Action: "insert",
Table: "asp_app_perm_201701",
New: &model.OldToken{
Mid: 4186264,
AppID: 1,
AccessToken: "test token",
RefreshToken: "test refresh",
AppSubID: 0,
CreateAt: 123456789000,
},
}
err := s.handleToken(token)
So(err, ShouldBeNil)
})
}
func Test_HandleCookie(t *testing.T) {
once.Do(startService)
Convey("Test del cookie by cookie", t, func() {
cookie := &cookieBMsg{
Action: "insert",
Table: "asp_app_perm_201701",
New: &model.OldCookie{
Mid: 4186264,
Session: "test session",
CSRFToken: "test csrf",
Expires: 1234567890000,
},
}
err := s.handleCookie(cookie)
So(err, ShouldBeNil)
})
}