Skip to content

Commit

Permalink
Update test case for empty global security
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTeaCat authored and daveshanley committed Jan 30, 2024
1 parent 48d643b commit 36b6e86
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions functions/owasp/check_security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ func TestCheckSecurity_SecurityGlobalDefined_Empty(t *testing.T) {
info:
version: "1.2.3"
title: "securitySchemes"
security:
- {}
security: []
paths:
/insecure:
put:
Expand Down Expand Up @@ -279,8 +278,8 @@ components:
res := CheckSecurity{}.RunRule(nil, ctx)

assert.Len(t, res, 2)
assert.Equal(t, "`security` is empty for path `/insecure` in method `put`", res[0].Message)
assert.Equal(t, "`security` was not defined for path `/insecure` in method `put`", res[0].Message)
assert.Equal(t, "$.paths['/insecure'].put", res[0].Path)
assert.Equal(t, "`security` is empty for path `/secure` in method `put`", res[1].Message)
assert.Equal(t, "`security` was not defined for path `/secure` in method `put`", res[1].Message)
assert.Equal(t, "$.paths['/secure'].put", res[1].Path)
}

0 comments on commit 36b6e86

Please sign in to comment.