Skip to content

Commit

Permalink
increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
JarekKa committed Dec 12, 2023
1 parent 8eb3f0e commit ec8385f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions driver/configuration/provider_koanf_public_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,21 @@ func TestKoanfProvider(t *testing.T) {
})
}

func TestToScopesValidation(t *testing.T) {
p, err := configuration.NewKoanfProvider(
context.Background(),
nil,
logrusx.New("", ""),
configx.WithConfigFiles("./../../internal/config/.oathkeeper.yaml"),
)
require.NoError(t, err)

assert.Nil(t, p.ToScopesValidation("default", "foo")(map[string]bool{"foo": true}))
assert.NotNil(t, p.ToScopesValidation("default", "foo")(map[string]bool{"foo": true, "bar": false}))
assert.Nil(t, p.ToScopesValidation("any", "foo")(map[string]bool{"foo": true, "bar": false}))
assert.NotNil(t, p.ToScopesValidation("whatever", "foo")(map[string]bool{"foo": true, "bar": false}))
}

func TestToScopeStrategy(t *testing.T) {
p, err := configuration.NewKoanfProvider(
context.Background(),
Expand Down

0 comments on commit ec8385f

Please sign in to comment.