butterrobot/internal/testutil/mock_cache.go
Felipe M. d09b763aa7
Some checks failed
ci/woodpecker/push/ci Pipeline failed
feat: hltb plugin
2025-06-12 14:51:12 +02:00

29 lines
731 B
Go

package testutil
import (
"errors"
"time"
)
// MockCache implements the CacheInterface for testing
type MockCache struct{}
func (m *MockCache) Get(key string, destination interface{}) error {
return errors.New("cache miss") // Always return cache miss for tests
}
func (m *MockCache) Set(key string, value interface{}, expiration *time.Time) error {
return nil // Always succeed for tests
}
func (m *MockCache) SetWithTTL(key string, value interface{}, ttl time.Duration) error {
return nil // Always succeed for tests
}
func (m *MockCache) Delete(key string) error {
return nil // Always succeed for tests
}
func (m *MockCache) Exists(key string) (bool, error) {
return false, nil // Always return false for tests
}