Skip to content

Commit

Permalink
tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
dadrus committed Jul 27, 2022
1 parent f7a27b9 commit 269df50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions internal/pipeline/authenticators/jwt_authenticator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ assertions:

// token extractor settings
assert.IsType(t, extractors.CompositeExtractStrategy{}, auth.ads)
assert.Len(t, auth.ads, 2)
assert.Len(t, auth.ads, 3)
assert.Contains(t, auth.ads, extractors.HeaderValueExtractStrategy{Name: "Authorization", Prefix: "Bearer"})
assert.Contains(t, auth.ads, extractors.QueryParameterExtractStrategy{Name: "access_token"})
assert.Contains(t, auth.ads, extractors.BodyParameterExtractStrategy{Name: "access_token"})

// assertions settings
assert.NoError(t, auth.a.ScopesMatcher.Match([]string{}))
Expand Down Expand Up @@ -159,9 +160,10 @@ cache_ttl: 5s`),

// token extractor settings
assert.IsType(t, extractors.CompositeExtractStrategy{}, auth.ads)
assert.Len(t, auth.ads, 2)
assert.Len(t, auth.ads, 3)
assert.Contains(t, auth.ads, extractors.HeaderValueExtractStrategy{Name: "Authorization", Prefix: "Bearer"})
assert.Contains(t, auth.ads, extractors.QueryParameterExtractStrategy{Name: "access_token"})
assert.Contains(t, auth.ads, extractors.BodyParameterExtractStrategy{Name: "access_token"})

// assertions settings
assert.NoError(t, auth.a.ScopesMatcher.Match([]string{}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ session:

// assert token extractor settings
assert.IsType(t, extractors.CompositeExtractStrategy{}, auth.ads)
assert.Len(t, auth.ads, 2)
assert.Len(t, auth.ads, 3)
assert.Contains(t, auth.ads, extractors.HeaderValueExtractStrategy{Name: "Authorization", Prefix: "Bearer"})
assert.Contains(t, auth.ads, extractors.QueryParameterExtractStrategy{Name: "access_token"})
assert.Contains(t, auth.ads, extractors.BodyParameterExtractStrategy{Name: "access_token"})

// assert subject factory
assert.NotNil(t, auth.sf)
Expand Down

0 comments on commit 269df50

Please sign in to comment.