github.com/haalcala/mattermost-server-change-repo/v5@v5.33.2/store/storetest/mocks/RoleStore.go (about) 1 // Code generated by mockery v1.0.0. DO NOT EDIT. 2 3 // Regenerate this file using `make store-mocks`. 4 5 package mocks 6 7 import ( 8 model "github.com/mattermost/mattermost-server/v5/model" 9 mock "github.com/stretchr/testify/mock" 10 ) 11 12 // RoleStore is an autogenerated mock type for the RoleStore type 13 type RoleStore struct { 14 mock.Mock 15 } 16 17 // AllChannelSchemeRoles provides a mock function with given fields: 18 func (_m *RoleStore) AllChannelSchemeRoles() ([]*model.Role, error) { 19 ret := _m.Called() 20 21 var r0 []*model.Role 22 if rf, ok := ret.Get(0).(func() []*model.Role); ok { 23 r0 = rf() 24 } else { 25 if ret.Get(0) != nil { 26 r0 = ret.Get(0).([]*model.Role) 27 } 28 } 29 30 var r1 error 31 if rf, ok := ret.Get(1).(func() error); ok { 32 r1 = rf() 33 } else { 34 r1 = ret.Error(1) 35 } 36 37 return r0, r1 38 } 39 40 // ChannelHigherScopedPermissions provides a mock function with given fields: roleNames 41 func (_m *RoleStore) ChannelHigherScopedPermissions(roleNames []string) (map[string]*model.RolePermissions, error) { 42 ret := _m.Called(roleNames) 43 44 var r0 map[string]*model.RolePermissions 45 if rf, ok := ret.Get(0).(func([]string) map[string]*model.RolePermissions); ok { 46 r0 = rf(roleNames) 47 } else { 48 if ret.Get(0) != nil { 49 r0 = ret.Get(0).(map[string]*model.RolePermissions) 50 } 51 } 52 53 var r1 error 54 if rf, ok := ret.Get(1).(func([]string) error); ok { 55 r1 = rf(roleNames) 56 } else { 57 r1 = ret.Error(1) 58 } 59 60 return r0, r1 61 } 62 63 // ChannelRolesUnderTeamRole provides a mock function with given fields: roleName 64 func (_m *RoleStore) ChannelRolesUnderTeamRole(roleName string) ([]*model.Role, error) { 65 ret := _m.Called(roleName) 66 67 var r0 []*model.Role 68 if rf, ok := ret.Get(0).(func(string) []*model.Role); ok { 69 r0 = rf(roleName) 70 } else { 71 if ret.Get(0) != nil { 72 r0 = ret.Get(0).([]*model.Role) 73 } 74 } 75 76 var r1 error 77 if rf, ok := ret.Get(1).(func(string) error); ok { 78 r1 = rf(roleName) 79 } else { 80 r1 = ret.Error(1) 81 } 82 83 return r0, r1 84 } 85 86 // Delete provides a mock function with given fields: roleId 87 func (_m *RoleStore) Delete(roleId string) (*model.Role, error) { 88 ret := _m.Called(roleId) 89 90 var r0 *model.Role 91 if rf, ok := ret.Get(0).(func(string) *model.Role); ok { 92 r0 = rf(roleId) 93 } else { 94 if ret.Get(0) != nil { 95 r0 = ret.Get(0).(*model.Role) 96 } 97 } 98 99 var r1 error 100 if rf, ok := ret.Get(1).(func(string) error); ok { 101 r1 = rf(roleId) 102 } else { 103 r1 = ret.Error(1) 104 } 105 106 return r0, r1 107 } 108 109 // Get provides a mock function with given fields: roleId 110 func (_m *RoleStore) Get(roleId string) (*model.Role, error) { 111 ret := _m.Called(roleId) 112 113 var r0 *model.Role 114 if rf, ok := ret.Get(0).(func(string) *model.Role); ok { 115 r0 = rf(roleId) 116 } else { 117 if ret.Get(0) != nil { 118 r0 = ret.Get(0).(*model.Role) 119 } 120 } 121 122 var r1 error 123 if rf, ok := ret.Get(1).(func(string) error); ok { 124 r1 = rf(roleId) 125 } else { 126 r1 = ret.Error(1) 127 } 128 129 return r0, r1 130 } 131 132 // GetAll provides a mock function with given fields: 133 func (_m *RoleStore) GetAll() ([]*model.Role, error) { 134 ret := _m.Called() 135 136 var r0 []*model.Role 137 if rf, ok := ret.Get(0).(func() []*model.Role); ok { 138 r0 = rf() 139 } else { 140 if ret.Get(0) != nil { 141 r0 = ret.Get(0).([]*model.Role) 142 } 143 } 144 145 var r1 error 146 if rf, ok := ret.Get(1).(func() error); ok { 147 r1 = rf() 148 } else { 149 r1 = ret.Error(1) 150 } 151 152 return r0, r1 153 } 154 155 // GetByName provides a mock function with given fields: name 156 func (_m *RoleStore) GetByName(name string) (*model.Role, error) { 157 ret := _m.Called(name) 158 159 var r0 *model.Role 160 if rf, ok := ret.Get(0).(func(string) *model.Role); ok { 161 r0 = rf(name) 162 } else { 163 if ret.Get(0) != nil { 164 r0 = ret.Get(0).(*model.Role) 165 } 166 } 167 168 var r1 error 169 if rf, ok := ret.Get(1).(func(string) error); ok { 170 r1 = rf(name) 171 } else { 172 r1 = ret.Error(1) 173 } 174 175 return r0, r1 176 } 177 178 // GetByNames provides a mock function with given fields: names 179 func (_m *RoleStore) GetByNames(names []string) ([]*model.Role, error) { 180 ret := _m.Called(names) 181 182 var r0 []*model.Role 183 if rf, ok := ret.Get(0).(func([]string) []*model.Role); ok { 184 r0 = rf(names) 185 } else { 186 if ret.Get(0) != nil { 187 r0 = ret.Get(0).([]*model.Role) 188 } 189 } 190 191 var r1 error 192 if rf, ok := ret.Get(1).(func([]string) error); ok { 193 r1 = rf(names) 194 } else { 195 r1 = ret.Error(1) 196 } 197 198 return r0, r1 199 } 200 201 // PermanentDeleteAll provides a mock function with given fields: 202 func (_m *RoleStore) PermanentDeleteAll() error { 203 ret := _m.Called() 204 205 var r0 error 206 if rf, ok := ret.Get(0).(func() error); ok { 207 r0 = rf() 208 } else { 209 r0 = ret.Error(0) 210 } 211 212 return r0 213 } 214 215 // Save provides a mock function with given fields: role 216 func (_m *RoleStore) Save(role *model.Role) (*model.Role, error) { 217 ret := _m.Called(role) 218 219 var r0 *model.Role 220 if rf, ok := ret.Get(0).(func(*model.Role) *model.Role); ok { 221 r0 = rf(role) 222 } else { 223 if ret.Get(0) != nil { 224 r0 = ret.Get(0).(*model.Role) 225 } 226 } 227 228 var r1 error 229 if rf, ok := ret.Get(1).(func(*model.Role) error); ok { 230 r1 = rf(role) 231 } else { 232 r1 = ret.Error(1) 233 } 234 235 return r0, r1 236 }