forked from goplus/yap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgop_autogen_test.go
38 lines (35 loc) · 1.07 KB
/
gop_autogen_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Code generated by gop (Go+); DO NOT EDIT.
package main
import (
"github.com/goplus/yap/ytest"
"github.com/goplus/yap/ytest/auth/jwt"
"github.com/qiniu/x/stringutil"
"testing"
"time"
)
type case_jwtdemo struct {
ytest.CaseApp
}
//line ytest/demo/jwtdemo/jwtdemo_ytest.gox:7
func (this *case_jwtdemo) Main() {
//line ytest/demo/jwtdemo/jwtdemo_ytest.gox:7:1
this.Mock("foo.com", new(AppV2))
//line ytest/demo/jwtdemo/jwtdemo_ytest.gox:9:1
testuser := jwt.HS256("<secret key>").Audience("testuser").Expiration(time.Now().Add(time.Hour))
//line ytest/demo/jwtdemo/jwtdemo_ytest.gox:11:1
id := "123"
//line ytest/demo/jwtdemo/jwtdemo_ytest.gox:12:1
this.Get(stringutil.Concat("http://foo.com/p/", id))
//line ytest/demo/jwtdemo/jwtdemo_ytest.gox:13:1
this.Auth(testuser)
//line ytest/demo/jwtdemo/jwtdemo_ytest.gox:14:1
this.RetWith(200)
//line ytest/demo/jwtdemo/jwtdemo_ytest.gox:15:1
this.Json(map[string]string{"id": id})
}
func (this *case_jwtdemo) Classfname() string {
return "jwtdemo"
}
func Test_jwtdemo(t *testing.T) {
ytest.Gopt_CaseApp_TestMain(new(case_jwtdemo), t)
}