Skip to content

Commit

Permalink
Increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jjngx committed May 8, 2023
1 parent dbab3d2 commit 2cb2cd8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pkg/apis/configuration/validation/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,12 @@ func TestValidateClientID_FailsOnInvalidInput(t *testing.T) {
func TestValidateURL_PassesOnValidInput(t *testing.T) {
t.Parallel()

validInput := []string{"http://google.com/auth", "https://foo.bar/baz", "http://127.0.0.1/bar", "http://openid.connect.com:8080/foo"}
validInput := []string{
"http://google.com/auth",
"https://foo.bar/baz",
"http://127.0.0.1/bar",
"http://openid.connect.com:8080/foo",
}

for _, test := range validInput {
allErrs := validateURL(test, field.NewPath("authEndpoint"))
Expand All @@ -1281,7 +1286,14 @@ func TestValidateURL_PassesOnValidInput(t *testing.T) {
func TestValidateURL_FailsOnInvalidInput(t *testing.T) {
t.Parallel()

invalidInput := []string{"www.google..foo.com", "http://{foo.bar", `https://google.foo\bar`, "http://foo.bar:8080", "http://foo.bar:812345/fooo"}
invalidInput := []string{
"www.google..foo.com",
"http://{foo.bar",
`https://google.foo\bar`,
"http://foo.bar:8080",
"http://foo.bar:812345/fooo",
"http://",
}

for _, test := range invalidInput {
allErrs := validateURL(test, field.NewPath("authEndpoint"))
Expand Down

0 comments on commit 2cb2cd8

Please sign in to comment.