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

Function TestInMemoryRefreshTokenStore_Set

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

Source from the content-addressed store, hash-verified

39}
40
41func TestInMemoryRefreshTokenStore_Set(t *testing.T) {
42 store := NewInMemoryRefreshTokenStore()
43 user := &User{ID: "123", Username: "testuser", Email: "test@example.com"}
44 expiry := time.Now().Add(time.Hour)
45
46 err := store.Set(context.Background(), "token123", user, expiry)
47 if err != nil {
48 t.Fatalf("Set() returned error: %v", err)
49 }
50
51 count, _ := store.Count(context.Background())
52 if count != 1 {
53 t.Fatalf("Expected count to be 1, got %d", count)
54 }
55}
56
57func TestInMemoryRefreshTokenStore_SetEmptyToken(t *testing.T) {
58 store := NewInMemoryRefreshTokenStore()

Callers

nothing calls this directly

Calls 3

SetMethod · 0.95
CountMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…