Files
wakapi/mocks/key_value_service.go
2025-10-14 08:18:02 +02:00

57 lines
1.3 KiB
Go

package mocks
import (
"github.com/muety/wakapi/models"
"github.com/stretchr/testify/mock"
"gorm.io/gorm"
)
type KeyValueServiceMock struct {
mock.Mock
}
func (m *KeyValueServiceMock) GetString(s string) (*models.KeyStringValue, error) {
args := m.Called(s)
return args.Get(0).(*models.KeyStringValue), args.Error(1)
}
func (m *KeyValueServiceMock) MustGetString(s string) *models.KeyStringValue {
args := m.Called(s)
return args.Get(0).(*models.KeyStringValue)
}
func (m *KeyValueServiceMock) GetByPrefix(s string) ([]*models.KeyStringValue, error) {
args := m.Called(s)
return args.Get(0).([]*models.KeyStringValue), args.Error(1)
}
func (m *KeyValueServiceMock) PutString(v *models.KeyStringValue) error {
args := m.Called(v)
return args.Error(0)
}
func (m *KeyValueServiceMock) DeleteString(s string) error {
args := m.Called(s)
return args.Error(0)
}
func (m *KeyValueServiceMock) DeleteStringTx(s string, d *gorm.DB) error {
args := m.Called(s, d)
return args.Error(0)
}
func (m *KeyValueServiceMock) DeleteWildcard(s string) error {
args := m.Called(s)
return args.Error(0)
}
func (m *KeyValueServiceMock) DeleteWildcardTx(s string, d *gorm.DB) error {
args := m.Called(s, d)
return args.Error(0)
}
func (m *KeyValueServiceMock) ReplaceKeySuffix(s1, s2 string) error {
args := m.Called(s1, s2)
return args.Error(0)
}