func TestCacheLoad(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	assert.Logf("testing cache load based cleanup")
	cacheTime := 100 * time.Millisecond
	cache := jwt.NewCache(2*cacheTime, cacheTime, cacheTime, 4)
	claims := initClaims()
	// Now fill the cache and check that it doesn't
	// grow too high.
	var i int
	for i = 0; i < 10; i++ {
		time.Sleep(50 * time.Millisecond)
		key := []byte(fmt.Sprintf("secret-%d", i))
		jwtIn, err := jwt.Encode(claims, key, jwt.HS512)
		assert.Nil(err)
		size := cache.Put(jwtIn)
		assert.True(size < 6)
	}
}
// TestCacheLoad tests the cache load based cleanup.
TestCacheLoad tests the cache load based cleanup.
// TestCacheLoad tests the cache load based cleanup .
func TestCacheLoad(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	assert.Logf("testing cache load based cleanup")
	cacheTime := 100 * time.Millisecond
	cache := jwt.NewCache(2*cacheTime, cacheTime, cacheTime, 4)
	claims := initClaims()
	var i int
	for i = 0; i < 10; i++ {
		time.Sleep(50 * time.Millisecond)
		key := []byte(fmt.Sprintf("secret-%d", i))
		jwtIn, err := jwt.Encode(claims, key, jwt.HS512)
		assert.Nil(err)
		size := cache.Put(jwtIn)
		assert.True(size < 6)
	}
}
func TestCacheLoad ( t * testing . T ) { assert := audit . NewTestingAssertion ( t , true ) assert . Logf ( " " ) cacheTime := 100 * time . Millisecond cache := jwt . NewCache ( 2 * cacheTime , cacheTime , cacheTime , 4 ) claims := initClaims ( ) var i int for i = 0 ; i < 10 ; i ++ { time . Sleep ( 50 * time . Millisecond ) key := [ ] byte ( fmt . Sprintf ( " " , i ) ) jwtIn , err := jwt . Encode ( claims , key , jwt . HS512 ) assert . Nil ( err ) size := cache . Put ( jwtIn ) assert . True ( size < 6 ) } }
TestCacheLoad tests the cache load based cleanup.
TestCacheLoad tests the cache load based cleanup .
// Now fill the cache and check that it doesn't // grow too high.