Skip to content

Commit

Permalink
Add new fields to validator test and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hdonCr committed Dec 24, 2024
1 parent ca00a1f commit ab835f5
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ab835f5

Please # to comment.