Skip to content

Commit

Permalink
tests: fix plugin defaulting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Apr 3, 2024
1 parent 95e9e2a commit a563c04
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions kong/plugin_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ func TestFillPluginDefaults(T *testing.T) {
}{
{
name: "no config no protocols",
version: ">=3.7.0",
version: ">=3.6.0",
plugin: &Plugin{
Name: String("basic-auth"),
RunOn: String("test"),
Expand All @@ -575,15 +575,17 @@ func TestFillPluginDefaults(T *testing.T) {
Config: Configuration{
"anonymous": nil,
"hide_credentials": false,
"realm": "service",
// NOTE: realm has been introduced in 3.6 basic auth schema
// https://docs.konghq.com/hub/kong-inc/basic-auth/changelog/#kong-gateway-36x
"realm": "service",
},
Protocols: []*string{String("grpc"), String("grpcs"), String("http"), String("https")},
Enabled: Bool(true),
},
},
{
name: "no config no protocols",
version: "<3.7.0",
version: "<3.6.0",
plugin: &Plugin{
Name: String("basic-auth"),
RunOn: String("test"),
Expand All @@ -601,7 +603,7 @@ func TestFillPluginDefaults(T *testing.T) {
},
{
name: "partial config no protocols",
version: ">=3.7.0",
version: ">=3.6.0",
plugin: &Plugin{
Name: String("basic-auth"),
Consumer: &Consumer{
Expand All @@ -619,15 +621,17 @@ func TestFillPluginDefaults(T *testing.T) {
Config: Configuration{
"anonymous": nil,
"hide_credentials": true,
"realm": "service",
// NOTE: realm has been introduced in 3.6 basic auth schema
// https://docs.konghq.com/hub/kong-inc/basic-auth/changelog/#kong-gateway-36x
"realm": "service",
},
Protocols: []*string{String("grpc"), String("grpcs"), String("http"), String("https")},
Enabled: Bool(true),
},
},
{
name: "partial config no protocols",
version: "<3.7.0",
version: "<3.6.0",
plugin: &Plugin{
Name: String("basic-auth"),
Consumer: &Consumer{
Expand Down

0 comments on commit a563c04

Please sign in to comment.