-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock.go
43 lines (38 loc) · 930 Bytes
/
mock.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
39
40
41
42
43
package jwt
type MockDescription struct {
Expected struct {
Create struct {
Jwt string
Error error
}
Parse struct {
Token Token
Error error
}
GetHeaders struct {
Headers Headers
}
GetClaims struct {
Claims Claims
}
GetParseOptions struct {
ParseOptions ParseOptions
}
}
}
var Mock MockDescription
func (s *MockDescription) Create(_ Claims, _ ...Headers) (string, error) {
return Mock.Expected.Create.Jwt, Mock.Expected.Create.Error
}
func (s *MockDescription) Parse(_ string, _ ...ParseOptions) (Token, string, error) {
return Mock.Expected.Parse.Token, "", Mock.Expected.Parse.Error
}
func (s *MockDescription) GetHeaders() Headers {
return Mock.Expected.GetHeaders.Headers
}
func (s *MockDescription) GetClaims() Claims {
return Mock.Expected.GetClaims.Claims
}
func (s *MockDescription) GetParseOptions() ParseOptions {
return Mock.Expected.GetParseOptions.ParseOptions
}