Skip to content

Commit e107f51

Browse files
committed
Merge branch 'hdonCr/allow-multiple-audiences' of https://github.com/hdonCr/jwt into hdonCr/allow-multiple-audiences
2 parents ca1d34c + f1c5576 commit e107f51

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

validator_test.go

+16-12
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ func (m MyCustomClaims) Validate() error {
2222

2323
func Test_Validator_Validate(t *testing.T) {
2424
type fields struct {
25-
leeway time.Duration
26-
timeFunc func() time.Time
27-
verifyIat bool
28-
expectedAud string
29-
expectedIss string
30-
expectedSub string
25+
leeway time.Duration
26+
timeFunc func() time.Time
27+
verifyIat bool
28+
expectedAud string
29+
expectedAuds []string
30+
expectedAudsMatchAll bool
31+
expectedIss string
32+
expectedSub string
3133
}
3234
type args struct {
3335
claims Claims
@@ -72,12 +74,14 @@ func Test_Validator_Validate(t *testing.T) {
7274
for _, tt := range tests {
7375
t.Run(tt.name, func(t *testing.T) {
7476
v := &Validator{
75-
leeway: tt.fields.leeway,
76-
timeFunc: tt.fields.timeFunc,
77-
verifyIat: tt.fields.verifyIat,
78-
expectedAud: tt.fields.expectedAud,
79-
expectedIss: tt.fields.expectedIss,
80-
expectedSub: tt.fields.expectedSub,
77+
leeway: tt.fields.leeway,
78+
timeFunc: tt.fields.timeFunc,
79+
verifyIat: tt.fields.verifyIat,
80+
expectedAud: tt.fields.expectedAud,
81+
expectedAuds: tt.fields.expectedAuds,
82+
expectedAudsMatchAll: tt.fields.expectedAudsMatchAll,
83+
expectedIss: tt.fields.expectedIss,
84+
expectedSub: tt.fields.expectedSub,
8185
}
8286
if err := v.Validate(tt.args.claims); (err != nil) && !errors.Is(err, tt.wantErr) {
8387
t.Errorf("validator.Validate() error = %v, wantErr %v", err, tt.wantErr)

0 commit comments

Comments
 (0)