Skip to content

Commit

Permalink
fixed panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Facchetti committed Jul 3, 2023
1 parent 41ce0f6 commit 79ccbcc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/portal/middleware/aad_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ func TestAAD(t *testing.T) {
{name: "forbidden", forbiddenReturn: true},
{name: "error", errReturn: errors.New("expired")},
}
logger := logrus.New()
logger.SetOutput(io.Discard)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
aadStruct := &aad{accessValidator: fakeAccessValidator{user: tt.userReturn, groups: tt.groupsReturn, forbidden: tt.forbiddenReturn, err: tt.errReturn}}
aadStruct := &aad{accessValidator: fakeAccessValidator{user: tt.userReturn, groups: tt.groupsReturn, forbidden: tt.forbiddenReturn, err: tt.errReturn}, log: logger.WithContext(context.Background())}

dummyRequest, _ := http.NewRequest(http.MethodGet, "https://redhat.com/hello", nil)
dummyRequest.AddCookie(&http.Cookie{Name: OIDCCookie, Value: "supertoken"})
Expand Down

0 comments on commit 79ccbcc

Please sign in to comment.