chore: update unit test

Signed-off-by: Shivanshu Raj Shrivastava <shivanshu1333@gmail.com>
This commit is contained in:
Shivanshu Raj Shrivastava 2025-05-30 10:24:01 +05:30
parent 5b7ce41d0d
commit cad3bf6883
No known key found for this signature in database
GPG Key ID: D34D26C62AC3E9AE

View File

@ -397,8 +397,11 @@ func TestGetClaims(t *testing.T) {
expectError: false,
},
{
name: "no claims in context",
setup: func(r *http.Request) {},
name: "no claims in context",
setup: func(r *http.Request) {
claims := authtypes.Claims{}
*r = *r.WithContext(authtypes.NewContextWithClaims(r.Context(), claims))
},
expectError: true,
},
}
@ -410,8 +413,7 @@ func TestGetClaims(t *testing.T) {
claims, err := authtypes.ClaimsFromContext(req.Context())
if tt.expectError {
assert.Error(t, err)
assert.Nil(t, claims.Audience)
assert.Equal(t, authtypes.Claims{}, claims)
} else {
assert.NoError(t, err)
assert.NotNil(t, claims)