mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 14:45:53 +08:00
chore: update unit test
Signed-off-by: Shivanshu Raj Shrivastava <shivanshu1333@gmail.com>
This commit is contained in:
parent
5b7ce41d0d
commit
cad3bf6883
@ -398,7 +398,10 @@ func TestGetClaims(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "no claims in context",
|
||||
setup: func(r *http.Request) {},
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user