[MM-20353] Change KVSetWithOptions to accept a byte slice (#13213)

* Drop EncodeJSON from PluginKVSetOptions

* Add unit tests for KVSetWithOptions with nil values
Этот коммит содержится в:
Ben Schumacher
2019-12-03 10:46:15 +01:00
коммит произвёл GitHub
родитель 3543fcce6c
Коммит d0d6ce0a70
11 изменённых файлов: 104 добавлений и 161 удалений

Просмотреть файл

@@ -184,18 +184,18 @@ func (_m *PluginStore) SaveOrUpdate(keyVal *model.PluginKeyValue) (*model.Plugin
}
// SetWithOptions provides a mock function with given fields: pluginId, key, value, options
func (_m *PluginStore) SetWithOptions(pluginId string, key string, value interface{}, options model.PluginKVSetOptions) (bool, *model.AppError) {
func (_m *PluginStore) SetWithOptions(pluginId string, key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) {
ret := _m.Called(pluginId, key, value, options)
var r0 bool
if rf, ok := ret.Get(0).(func(string, string, interface{}, model.PluginKVSetOptions) bool); ok {
if rf, ok := ret.Get(0).(func(string, string, []byte, model.PluginKVSetOptions) bool); ok {
r0 = rf(pluginId, key, value, options)
} else {
r0 = ret.Get(0).(bool)
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string, string, interface{}, model.PluginKVSetOptions) *model.AppError); ok {
if rf, ok := ret.Get(1).(func(string, string, []byte, model.PluginKVSetOptions) *model.AppError); ok {
r1 = rf(pluginId, key, value, options)
} else {
if ret.Get(1) != nil {