MCPcopy
hub / github.com/appleboy/gin-jwt / TestInMemoryRefreshTokenStore_SetEmptyToken

Function TestInMemoryRefreshTokenStore_SetEmptyToken

store/memory_test.go:57–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestInMemoryRefreshTokenStore_SetEmptyToken(t *testing.T) {
58 store := NewInMemoryRefreshTokenStore()
59 user := &User{ID: "123", Username: "testuser"}
60 expiry := time.Now().Add(time.Hour)
61
62 err := store.Set(context.Background(), "", user, expiry)
63 if err == nil {
64 t.Fatal("Set() should return error for empty token")
65 }
66
67 if err.Error() != "token cannot be empty" {
68 t.Fatalf("Expected 'token cannot be empty' error, got: %v", err)
69 }
70}
71
72func TestInMemoryRefreshTokenStore_Get(t *testing.T) {
73 store := NewInMemoryRefreshTokenStore()

Callers

nothing calls this directly

Calls 2

SetMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…