MCPcopy
hub / github.com/OpenNHP/opennhp / TestTokenStore_Delete

Function TestTokenStore_Delete

nhp/test/tokenstore_test.go:47–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestTokenStore_Delete(t *testing.T) {
48 ts := common.NewTokenStore[*testEntry]()
49
50 entry := &testEntry{value: "test", expireTime: time.Now().Add(1 * time.Hour)}
51 token := "token-to-delete"
52
53 ts.Store(token, entry)
54 ts.Delete(token)
55
56 _, found := ts.Load(token)
57 if found {
58 t.Error("expected token to be deleted")
59 }
60}
61
62func TestTokenStore_CleanExpired(t *testing.T) {
63 ts := common.NewTokenStore[*testEntry]()

Callers

nothing calls this directly

Calls 5

StoreMethod · 0.80
LoadMethod · 0.80
AddMethod · 0.65
ErrorMethod · 0.65
DeleteMethod · 0.45

Tested by

no test coverage detected