From 6e96688719305fdcbdca668f7c207d930e777909 Mon Sep 17 00:00:00 2001 From: Calvin Leung Huang Date: Fri, 15 Feb 2019 07:55:09 -0800 Subject: [PATCH] cacememdb: add LeaseToken and TokenParent tests for GetByPrefix --- command/agent/cache/cachememdb/cache_memdb_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/command/agent/cache/cachememdb/cache_memdb_test.go b/command/agent/cache/cachememdb/cache_memdb_test.go index 119943c311..4162fed0da 100644 --- a/command/agent/cache/cachememdb/cache_memdb_test.go +++ b/command/agent/cache/cachememdb/cache_memdb_test.go @@ -131,8 +131,10 @@ func TestCacheMemDB_GetByPrefix(t *testing.T) { Namespace: "test_ns/", RequestPath: "/v1/request/path/1", Token: "test_token", + TokenParent: "test_token_parent", TokenAccessor: "test_accessor", Lease: "path/to/test_lease/1", + LeaseToken: "test_lease_token", Response: []byte("hello world"), } @@ -146,8 +148,10 @@ func TestCacheMemDB_GetByPrefix(t *testing.T) { Namespace: "test_ns/", RequestPath: "/v1/request/path/2", Token: "test_token2", + TokenParent: "test_token_parent", TokenAccessor: "test_accessor2", Lease: "path/to/test_lease/2", + LeaseToken: "test_lease_token", Response: []byte("hello world"), } @@ -170,6 +174,16 @@ func TestCacheMemDB_GetByPrefix(t *testing.T) { "lease", []interface{}{"path/to/test_lease"}, }, + { + "by_token_parent", + "token_parent", + []interface{}{"test_token_parent"}, + }, + { + "by_lease_token", + "lease_token", + []interface{}{"test_lease_token"}, + }, } for _, tc := range testCases {