From d42faf30b034a945073744aa1a2374355c818645 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sat, 30 Apr 2022 21:17:57 -0700 Subject: [PATCH] fix WriteConfig interface. --- webapp/backend/pkg/config/mock/mock_config.go | 181 ++++++++++-------- 1 file changed, 98 insertions(+), 83 deletions(-) diff --git a/webapp/backend/pkg/config/mock/mock_config.go b/webapp/backend/pkg/config/mock/mock_config.go index c9ee399..8e54f6f 100644 --- a/webapp/backend/pkg/config/mock/mock_config.go +++ b/webapp/backend/pkg/config/mock/mock_config.go @@ -5,185 +5,186 @@ package mock_config import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" viper "github.com/spf13/viper" - reflect "reflect" ) -// MockInterface is a mock of Interface interface +// MockInterface is a mock of Interface interface. type MockInterface struct { ctrl *gomock.Controller recorder *MockInterfaceMockRecorder } -// MockInterfaceMockRecorder is the mock recorder for MockInterface +// MockInterfaceMockRecorder is the mock recorder for MockInterface. type MockInterfaceMockRecorder struct { mock *MockInterface } -// NewMockInterface creates a new mock instance +// NewMockInterface creates a new mock instance. func NewMockInterface(ctrl *gomock.Controller) *MockInterface { mock := &MockInterface{ctrl: ctrl} mock.recorder = &MockInterfaceMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder { return m.recorder } -// Init mocks base method -func (m *MockInterface) Init() error { +// AllSettings mocks base method. +func (m *MockInterface) AllSettings() map[string]interface{} { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Init") - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "AllSettings") + ret0, _ := ret[0].(map[string]interface{}) return ret0 } -// Init indicates an expected call of Init -func (mr *MockInterfaceMockRecorder) Init() *gomock.Call { +// AllSettings indicates an expected call of AllSettings. +func (mr *MockInterfaceMockRecorder) AllSettings() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockInterface)(nil).Init)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllSettings", reflect.TypeOf((*MockInterface)(nil).AllSettings)) } -// ReadConfig mocks base method -func (m *MockInterface) ReadConfig(configFilePath string) error { +// Get mocks base method. +func (m *MockInterface) Get(key string) interface{} { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ReadConfig", configFilePath) - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "Get", key) + ret0, _ := ret[0].(interface{}) return ret0 } -// ReadConfig indicates an expected call of ReadConfig -func (mr *MockInterfaceMockRecorder) ReadConfig(configFilePath interface{}) *gomock.Call { +// Get indicates an expected call of Get. +func (mr *MockInterfaceMockRecorder) Get(key interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadConfig", reflect.TypeOf((*MockInterface)(nil).ReadConfig), configFilePath) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockInterface)(nil).Get), key) } -// Set mocks base method -func (m *MockInterface) Set(key string, value interface{}) { +// GetBool mocks base method. +func (m *MockInterface) GetBool(key string) bool { m.ctrl.T.Helper() - m.ctrl.Call(m, "Set", key, value) + ret := m.ctrl.Call(m, "GetBool", key) + ret0, _ := ret[0].(bool) + return ret0 } -// Set indicates an expected call of Set -func (mr *MockInterfaceMockRecorder) Set(key, value interface{}) *gomock.Call { +// GetBool indicates an expected call of GetBool. +func (mr *MockInterfaceMockRecorder) GetBool(key interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockInterface)(nil).Set), key, value) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBool", reflect.TypeOf((*MockInterface)(nil).GetBool), key) } -// SetDefault mocks base method -func (m *MockInterface) SetDefault(key string, value interface{}) { +// GetInt mocks base method. +func (m *MockInterface) GetInt(key string) int { m.ctrl.T.Helper() - m.ctrl.Call(m, "SetDefault", key, value) + ret := m.ctrl.Call(m, "GetInt", key) + ret0, _ := ret[0].(int) + return ret0 } -// SetDefault indicates an expected call of SetDefault -func (mr *MockInterfaceMockRecorder) SetDefault(key, value interface{}) *gomock.Call { +// GetInt indicates an expected call of GetInt. +func (mr *MockInterfaceMockRecorder) GetInt(key interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDefault", reflect.TypeOf((*MockInterface)(nil).SetDefault), key, value) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInt", reflect.TypeOf((*MockInterface)(nil).GetInt), key) } -// AllSettings mocks base method -func (m *MockInterface) AllSettings() map[string]interface{} { +// GetString mocks base method. +func (m *MockInterface) GetString(key string) string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AllSettings") - ret0, _ := ret[0].(map[string]interface{}) + ret := m.ctrl.Call(m, "GetString", key) + ret0, _ := ret[0].(string) return ret0 } -// AllSettings indicates an expected call of AllSettings -func (mr *MockInterfaceMockRecorder) AllSettings() *gomock.Call { +// GetString indicates an expected call of GetString. +func (mr *MockInterfaceMockRecorder) GetString(key interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllSettings", reflect.TypeOf((*MockInterface)(nil).AllSettings)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetString", reflect.TypeOf((*MockInterface)(nil).GetString), key) } -// IsSet mocks base method -func (m *MockInterface) IsSet(key string) bool { +// GetStringSlice mocks base method. +func (m *MockInterface) GetStringSlice(key string) []string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsSet", key) - ret0, _ := ret[0].(bool) + ret := m.ctrl.Call(m, "GetStringSlice", key) + ret0, _ := ret[0].([]string) return ret0 } -// IsSet indicates an expected call of IsSet -func (mr *MockInterfaceMockRecorder) IsSet(key interface{}) *gomock.Call { +// GetStringSlice indicates an expected call of GetStringSlice. +func (mr *MockInterfaceMockRecorder) GetStringSlice(key interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSet", reflect.TypeOf((*MockInterface)(nil).IsSet), key) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStringSlice", reflect.TypeOf((*MockInterface)(nil).GetStringSlice), key) } -// Get mocks base method -func (m *MockInterface) Get(key string) interface{} { +// Init mocks base method. +func (m *MockInterface) Init() error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", key) - ret0, _ := ret[0].(interface{}) + ret := m.ctrl.Call(m, "Init") + ret0, _ := ret[0].(error) return ret0 } -// Get indicates an expected call of Get -func (mr *MockInterfaceMockRecorder) Get(key interface{}) *gomock.Call { +// Init indicates an expected call of Init. +func (mr *MockInterfaceMockRecorder) Init() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockInterface)(nil).Get), key) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockInterface)(nil).Init)) } -// GetBool mocks base method -func (m *MockInterface) GetBool(key string) bool { +// IsSet mocks base method. +func (m *MockInterface) IsSet(key string) bool { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBool", key) + ret := m.ctrl.Call(m, "IsSet", key) ret0, _ := ret[0].(bool) return ret0 } -// GetBool indicates an expected call of GetBool -func (mr *MockInterfaceMockRecorder) GetBool(key interface{}) *gomock.Call { +// IsSet indicates an expected call of IsSet. +func (mr *MockInterfaceMockRecorder) IsSet(key interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBool", reflect.TypeOf((*MockInterface)(nil).GetBool), key) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSet", reflect.TypeOf((*MockInterface)(nil).IsSet), key) } -// GetInt mocks base method -func (m *MockInterface) GetInt(key string) int { +// ReadConfig mocks base method. +func (m *MockInterface) ReadConfig(configFilePath string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetInt", key) - ret0, _ := ret[0].(int) + ret := m.ctrl.Call(m, "ReadConfig", configFilePath) + ret0, _ := ret[0].(error) return ret0 } -// GetInt indicates an expected call of GetInt -func (mr *MockInterfaceMockRecorder) GetInt(key interface{}) *gomock.Call { +// ReadConfig indicates an expected call of ReadConfig. +func (mr *MockInterfaceMockRecorder) ReadConfig(configFilePath interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInt", reflect.TypeOf((*MockInterface)(nil).GetInt), key) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadConfig", reflect.TypeOf((*MockInterface)(nil).ReadConfig), configFilePath) } -// GetString mocks base method -func (m *MockInterface) GetString(key string) string { +// Set mocks base method. +func (m *MockInterface) Set(key string, value interface{}) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetString", key) - ret0, _ := ret[0].(string) - return ret0 + m.ctrl.Call(m, "Set", key, value) } -// GetString indicates an expected call of GetString -func (mr *MockInterfaceMockRecorder) GetString(key interface{}) *gomock.Call { +// Set indicates an expected call of Set. +func (mr *MockInterfaceMockRecorder) Set(key, value interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetString", reflect.TypeOf((*MockInterface)(nil).GetString), key) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockInterface)(nil).Set), key, value) } -// GetStringSlice mocks base method -func (m *MockInterface) GetStringSlice(key string) []string { +// SetDefault mocks base method. +func (m *MockInterface) SetDefault(key string, value interface{}) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStringSlice", key) - ret0, _ := ret[0].([]string) - return ret0 + m.ctrl.Call(m, "SetDefault", key, value) } -// GetStringSlice indicates an expected call of GetStringSlice -func (mr *MockInterfaceMockRecorder) GetStringSlice(key interface{}) *gomock.Call { +// SetDefault indicates an expected call of SetDefault. +func (mr *MockInterfaceMockRecorder) SetDefault(key, value interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStringSlice", reflect.TypeOf((*MockInterface)(nil).GetStringSlice), key) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDefault", reflect.TypeOf((*MockInterface)(nil).SetDefault), key, value) } -// UnmarshalKey mocks base method +// UnmarshalKey mocks base method. func (m *MockInterface) UnmarshalKey(key string, rawVal interface{}, decoderOpts ...viper.DecoderConfigOption) error { m.ctrl.T.Helper() varargs := []interface{}{key, rawVal} @@ -195,9 +196,23 @@ func (m *MockInterface) UnmarshalKey(key string, rawVal interface{}, decoderOpts return ret0 } -// UnmarshalKey indicates an expected call of UnmarshalKey +// UnmarshalKey indicates an expected call of UnmarshalKey. func (mr *MockInterfaceMockRecorder) UnmarshalKey(key, rawVal interface{}, decoderOpts ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{key, rawVal}, decoderOpts...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnmarshalKey", reflect.TypeOf((*MockInterface)(nil).UnmarshalKey), varargs...) } + +// WriteConfig mocks base method. +func (m *MockInterface) WriteConfig() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteConfig") + ret0, _ := ret[0].(error) + return ret0 +} + +// WriteConfig indicates an expected call of WriteConfig. +func (mr *MockInterfaceMockRecorder) WriteConfig() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteConfig", reflect.TypeOf((*MockInterface)(nil).WriteConfig)) +}