From ab835f55359ad419a5616bbeab88cbdb8a9f3b68 Mon Sep 17 00:00:00 2001 From: hdonCr Date: Tue, 24 Dec 2024 15:21:34 +0100 Subject: [PATCH] Add new fields to validator test and formatting --- validator_test.go | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/validator_test.go b/validator_test.go index 08a6bd71..74be34bc 100644 --- a/validator_test.go +++ b/validator_test.go @@ -22,12 +22,14 @@ func (m MyCustomClaims) Validate() error { func Test_Validator_Validate(t *testing.T) { type fields struct { - leeway time.Duration - timeFunc func() time.Time - verifyIat bool - expectedAud string - expectedIss string - expectedSub string + leeway time.Duration + timeFunc func() time.Time + verifyIat bool + expectedAud string + expectedAuds []string + expectedAudsMatchAll bool + expectedIss string + expectedSub string } type args struct { claims Claims @@ -72,12 +74,14 @@ func Test_Validator_Validate(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { v := &Validator{ - leeway: tt.fields.leeway, - timeFunc: tt.fields.timeFunc, - verifyIat: tt.fields.verifyIat, - expectedAud: tt.fields.expectedAud, - expectedIss: tt.fields.expectedIss, - expectedSub: tt.fields.expectedSub, + leeway: tt.fields.leeway, + timeFunc: tt.fields.timeFunc, + verifyIat: tt.fields.verifyIat, + expectedAud: tt.fields.expectedAud, + expectedAuds: tt.fields.expectedAuds, + expectedAudsMatchAll: tt.fields.expectedAudsMatchAll, + expectedIss: tt.fields.expectedIss, + expectedSub: tt.fields.expectedSub, } if err := v.Validate(tt.args.claims); (err != nil) && !errors.Is(err, tt.wantErr) { t.Errorf("validator.Validate() error = %v, wantErr %v", err, tt.wantErr)