package user import ( "context" "flag" "fmt" "testing" "git.i2edu.net/i2/go-zero/core/conf" "git.i2edu.net/i2/i2-bill-api/internal/config" "git.i2edu.net/i2/i2-bill-api/internal/logic/auth" "git.i2edu.net/i2/i2-bill-api/internal/svc" ) var configFile = flag.String("f", "etc/i2bill-api.yaml", "the config file") var c config.Config var ctx *svc.ServiceContext func TestMain(m *testing.M) { conf.MustLoad(*configFile, &c) ctx = svc.NewServiceContext(c) } func TestCreateJWT(t *testing.T) { l := auth.NewLoginByWeixinLogic(context.TODO(), ctx) fmt.Println(l.CreateJWT(1624415746, c.JwtAuth.AccessSecret, nil, 1000)) }