github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/server/agents/server_info_source_mock_test.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: agents.go 3 4 // Package agents is a generated GoMock package. 5 package agents 6 7 import ( 8 context "context" 9 json "encoding/json" 10 reflect "reflect" 11 time "time" 12 13 aagent "github.com/choria-io/go-choria/aagent" 14 build "github.com/choria-io/go-choria/build" 15 inter "github.com/choria-io/go-choria/inter" 16 lifecycle "github.com/choria-io/go-choria/lifecycle" 17 protocol "github.com/choria-io/go-choria/protocol" 18 ddl "github.com/choria-io/go-choria/providers/data/ddl" 19 statistics "github.com/choria-io/go-choria/statistics" 20 gomock "github.com/golang/mock/gomock" 21 ) 22 23 // MockAgent is a mock of Agent interface. 24 type MockAgent struct { 25 ctrl *gomock.Controller 26 recorder *MockAgentMockRecorder 27 } 28 29 // MockAgentMockRecorder is the mock recorder for MockAgent. 30 type MockAgentMockRecorder struct { 31 mock *MockAgent 32 } 33 34 // NewMockAgent creates a new mock instance. 35 func NewMockAgent(ctrl *gomock.Controller) *MockAgent { 36 mock := &MockAgent{ctrl: ctrl} 37 mock.recorder = &MockAgentMockRecorder{mock} 38 return mock 39 } 40 41 // EXPECT returns an object that allows the caller to indicate expected use. 42 func (m *MockAgent) EXPECT() *MockAgentMockRecorder { 43 return m.recorder 44 } 45 46 // HandleMessage mocks base method. 47 func (m *MockAgent) HandleMessage(arg0 context.Context, arg1 inter.Message, arg2 protocol.Request, arg3 inter.ConnectorInfo, arg4 chan *AgentReply) { 48 m.ctrl.T.Helper() 49 m.ctrl.Call(m, "HandleMessage", arg0, arg1, arg2, arg3, arg4) 50 } 51 52 // HandleMessage indicates an expected call of HandleMessage. 53 func (mr *MockAgentMockRecorder) HandleMessage(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { 54 mr.mock.ctrl.T.Helper() 55 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleMessage", reflect.TypeOf((*MockAgent)(nil).HandleMessage), arg0, arg1, arg2, arg3, arg4) 56 } 57 58 // Metadata mocks base method. 59 func (m *MockAgent) Metadata() *Metadata { 60 m.ctrl.T.Helper() 61 ret := m.ctrl.Call(m, "Metadata") 62 ret0, _ := ret[0].(*Metadata) 63 return ret0 64 } 65 66 // Metadata indicates an expected call of Metadata. 67 func (mr *MockAgentMockRecorder) Metadata() *gomock.Call { 68 mr.mock.ctrl.T.Helper() 69 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Metadata", reflect.TypeOf((*MockAgent)(nil).Metadata)) 70 } 71 72 // Name mocks base method. 73 func (m *MockAgent) Name() string { 74 m.ctrl.T.Helper() 75 ret := m.ctrl.Call(m, "Name") 76 ret0, _ := ret[0].(string) 77 return ret0 78 } 79 80 // Name indicates an expected call of Name. 81 func (mr *MockAgentMockRecorder) Name() *gomock.Call { 82 mr.mock.ctrl.T.Helper() 83 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAgent)(nil).Name)) 84 } 85 86 // ServerInfo mocks base method. 87 func (m *MockAgent) ServerInfo() ServerInfoSource { 88 m.ctrl.T.Helper() 89 ret := m.ctrl.Call(m, "ServerInfo") 90 ret0, _ := ret[0].(ServerInfoSource) 91 return ret0 92 } 93 94 // ServerInfo indicates an expected call of ServerInfo. 95 func (mr *MockAgentMockRecorder) ServerInfo() *gomock.Call { 96 mr.mock.ctrl.T.Helper() 97 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServerInfo", reflect.TypeOf((*MockAgent)(nil).ServerInfo)) 98 } 99 100 // SetServerInfo mocks base method. 101 func (m *MockAgent) SetServerInfo(arg0 ServerInfoSource) { 102 m.ctrl.T.Helper() 103 m.ctrl.Call(m, "SetServerInfo", arg0) 104 } 105 106 // SetServerInfo indicates an expected call of SetServerInfo. 107 func (mr *MockAgentMockRecorder) SetServerInfo(arg0 any) *gomock.Call { 108 mr.mock.ctrl.T.Helper() 109 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetServerInfo", reflect.TypeOf((*MockAgent)(nil).SetServerInfo), arg0) 110 } 111 112 // ShouldActivate mocks base method. 113 func (m *MockAgent) ShouldActivate() bool { 114 m.ctrl.T.Helper() 115 ret := m.ctrl.Call(m, "ShouldActivate") 116 ret0, _ := ret[0].(bool) 117 return ret0 118 } 119 120 // ShouldActivate indicates an expected call of ShouldActivate. 121 func (mr *MockAgentMockRecorder) ShouldActivate() *gomock.Call { 122 mr.mock.ctrl.T.Helper() 123 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShouldActivate", reflect.TypeOf((*MockAgent)(nil).ShouldActivate)) 124 } 125 126 // MockServerInfoSource is a mock of ServerInfoSource interface. 127 type MockServerInfoSource struct { 128 ctrl *gomock.Controller 129 recorder *MockServerInfoSourceMockRecorder 130 } 131 132 // MockServerInfoSourceMockRecorder is the mock recorder for MockServerInfoSource. 133 type MockServerInfoSourceMockRecorder struct { 134 mock *MockServerInfoSource 135 } 136 137 // NewMockServerInfoSource creates a new mock instance. 138 func NewMockServerInfoSource(ctrl *gomock.Controller) *MockServerInfoSource { 139 mock := &MockServerInfoSource{ctrl: ctrl} 140 mock.recorder = &MockServerInfoSourceMockRecorder{mock} 141 return mock 142 } 143 144 // EXPECT returns an object that allows the caller to indicate expected use. 145 func (m *MockServerInfoSource) EXPECT() *MockServerInfoSourceMockRecorder { 146 return m.recorder 147 } 148 149 // AgentMetadata mocks base method. 150 func (m *MockServerInfoSource) AgentMetadata(arg0 string) (Metadata, bool) { 151 m.ctrl.T.Helper() 152 ret := m.ctrl.Call(m, "AgentMetadata", arg0) 153 ret0, _ := ret[0].(Metadata) 154 ret1, _ := ret[1].(bool) 155 return ret0, ret1 156 } 157 158 // AgentMetadata indicates an expected call of AgentMetadata. 159 func (mr *MockServerInfoSourceMockRecorder) AgentMetadata(arg0 any) *gomock.Call { 160 mr.mock.ctrl.T.Helper() 161 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AgentMetadata", reflect.TypeOf((*MockServerInfoSource)(nil).AgentMetadata), arg0) 162 } 163 164 // BuildInfo mocks base method. 165 func (m *MockServerInfoSource) BuildInfo() *build.Info { 166 m.ctrl.T.Helper() 167 ret := m.ctrl.Call(m, "BuildInfo") 168 ret0, _ := ret[0].(*build.Info) 169 return ret0 170 } 171 172 // BuildInfo indicates an expected call of BuildInfo. 173 func (mr *MockServerInfoSourceMockRecorder) BuildInfo() *gomock.Call { 174 mr.mock.ctrl.T.Helper() 175 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildInfo", reflect.TypeOf((*MockServerInfoSource)(nil).BuildInfo)) 176 } 177 178 // Classes mocks base method. 179 func (m *MockServerInfoSource) Classes() []string { 180 m.ctrl.T.Helper() 181 ret := m.ctrl.Call(m, "Classes") 182 ret0, _ := ret[0].([]string) 183 return ret0 184 } 185 186 // Classes indicates an expected call of Classes. 187 func (mr *MockServerInfoSourceMockRecorder) Classes() *gomock.Call { 188 mr.mock.ctrl.T.Helper() 189 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Classes", reflect.TypeOf((*MockServerInfoSource)(nil).Classes)) 190 } 191 192 // ConfigFile mocks base method. 193 func (m *MockServerInfoSource) ConfigFile() string { 194 m.ctrl.T.Helper() 195 ret := m.ctrl.Call(m, "ConfigFile") 196 ret0, _ := ret[0].(string) 197 return ret0 198 } 199 200 // ConfigFile indicates an expected call of ConfigFile. 201 func (mr *MockServerInfoSourceMockRecorder) ConfigFile() *gomock.Call { 202 mr.mock.ctrl.T.Helper() 203 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigFile", reflect.TypeOf((*MockServerInfoSource)(nil).ConfigFile)) 204 } 205 206 // ConnectedServer mocks base method. 207 func (m *MockServerInfoSource) ConnectedServer() string { 208 m.ctrl.T.Helper() 209 ret := m.ctrl.Call(m, "ConnectedServer") 210 ret0, _ := ret[0].(string) 211 return ret0 212 } 213 214 // ConnectedServer indicates an expected call of ConnectedServer. 215 func (mr *MockServerInfoSourceMockRecorder) ConnectedServer() *gomock.Call { 216 mr.mock.ctrl.T.Helper() 217 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectedServer", reflect.TypeOf((*MockServerInfoSource)(nil).ConnectedServer)) 218 } 219 220 // DataFuncMap mocks base method. 221 func (m *MockServerInfoSource) DataFuncMap() (ddl.FuncMap, error) { 222 m.ctrl.T.Helper() 223 ret := m.ctrl.Call(m, "DataFuncMap") 224 ret0, _ := ret[0].(ddl.FuncMap) 225 ret1, _ := ret[1].(error) 226 return ret0, ret1 227 } 228 229 // DataFuncMap indicates an expected call of DataFuncMap. 230 func (mr *MockServerInfoSourceMockRecorder) DataFuncMap() *gomock.Call { 231 mr.mock.ctrl.T.Helper() 232 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DataFuncMap", reflect.TypeOf((*MockServerInfoSource)(nil).DataFuncMap)) 233 } 234 235 // Facts mocks base method. 236 func (m *MockServerInfoSource) Facts() json.RawMessage { 237 m.ctrl.T.Helper() 238 ret := m.ctrl.Call(m, "Facts") 239 ret0, _ := ret[0].(json.RawMessage) 240 return ret0 241 } 242 243 // Facts indicates an expected call of Facts. 244 func (mr *MockServerInfoSourceMockRecorder) Facts() *gomock.Call { 245 mr.mock.ctrl.T.Helper() 246 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Facts", reflect.TypeOf((*MockServerInfoSource)(nil).Facts)) 247 } 248 249 // Identity mocks base method. 250 func (m *MockServerInfoSource) Identity() string { 251 m.ctrl.T.Helper() 252 ret := m.ctrl.Call(m, "Identity") 253 ret0, _ := ret[0].(string) 254 return ret0 255 } 256 257 // Identity indicates an expected call of Identity. 258 func (mr *MockServerInfoSourceMockRecorder) Identity() *gomock.Call { 259 mr.mock.ctrl.T.Helper() 260 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Identity", reflect.TypeOf((*MockServerInfoSource)(nil).Identity)) 261 } 262 263 // KnownAgents mocks base method. 264 func (m *MockServerInfoSource) KnownAgents() []string { 265 m.ctrl.T.Helper() 266 ret := m.ctrl.Call(m, "KnownAgents") 267 ret0, _ := ret[0].([]string) 268 return ret0 269 } 270 271 // KnownAgents indicates an expected call of KnownAgents. 272 func (mr *MockServerInfoSourceMockRecorder) KnownAgents() *gomock.Call { 273 mr.mock.ctrl.T.Helper() 274 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KnownAgents", reflect.TypeOf((*MockServerInfoSource)(nil).KnownAgents)) 275 } 276 277 // LastProcessedMessage mocks base method. 278 func (m *MockServerInfoSource) LastProcessedMessage() time.Time { 279 m.ctrl.T.Helper() 280 ret := m.ctrl.Call(m, "LastProcessedMessage") 281 ret0, _ := ret[0].(time.Time) 282 return ret0 283 } 284 285 // LastProcessedMessage indicates an expected call of LastProcessedMessage. 286 func (mr *MockServerInfoSourceMockRecorder) LastProcessedMessage() *gomock.Call { 287 mr.mock.ctrl.T.Helper() 288 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastProcessedMessage", reflect.TypeOf((*MockServerInfoSource)(nil).LastProcessedMessage)) 289 } 290 291 // MachineTransition mocks base method. 292 func (m *MockServerInfoSource) MachineTransition(name, version, path, id, transition string) error { 293 m.ctrl.T.Helper() 294 ret := m.ctrl.Call(m, "MachineTransition", name, version, path, id, transition) 295 ret0, _ := ret[0].(error) 296 return ret0 297 } 298 299 // MachineTransition indicates an expected call of MachineTransition. 300 func (mr *MockServerInfoSourceMockRecorder) MachineTransition(name, version, path, id, transition any) *gomock.Call { 301 mr.mock.ctrl.T.Helper() 302 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MachineTransition", reflect.TypeOf((*MockServerInfoSource)(nil).MachineTransition), name, version, path, id, transition) 303 } 304 305 // MachinesStatus mocks base method. 306 func (m *MockServerInfoSource) MachinesStatus() ([]aagent.MachineState, error) { 307 m.ctrl.T.Helper() 308 ret := m.ctrl.Call(m, "MachinesStatus") 309 ret0, _ := ret[0].([]aagent.MachineState) 310 ret1, _ := ret[1].(error) 311 return ret0, ret1 312 } 313 314 // MachinesStatus indicates an expected call of MachinesStatus. 315 func (mr *MockServerInfoSourceMockRecorder) MachinesStatus() *gomock.Call { 316 mr.mock.ctrl.T.Helper() 317 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MachinesStatus", reflect.TypeOf((*MockServerInfoSource)(nil).MachinesStatus)) 318 } 319 320 // NewEvent mocks base method. 321 func (m *MockServerInfoSource) NewEvent(t lifecycle.Type, opts ...lifecycle.Option) error { 322 m.ctrl.T.Helper() 323 varargs := []any{t} 324 for _, a := range opts { 325 varargs = append(varargs, a) 326 } 327 ret := m.ctrl.Call(m, "NewEvent", varargs...) 328 ret0, _ := ret[0].(error) 329 return ret0 330 } 331 332 // NewEvent indicates an expected call of NewEvent. 333 func (mr *MockServerInfoSourceMockRecorder) NewEvent(t any, opts ...any) *gomock.Call { 334 mr.mock.ctrl.T.Helper() 335 varargs := append([]any{t}, opts...) 336 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewEvent", reflect.TypeOf((*MockServerInfoSource)(nil).NewEvent), varargs...) 337 } 338 339 // PrepareForShutdown mocks base method. 340 func (m *MockServerInfoSource) PrepareForShutdown() error { 341 m.ctrl.T.Helper() 342 ret := m.ctrl.Call(m, "PrepareForShutdown") 343 ret0, _ := ret[0].(error) 344 return ret0 345 } 346 347 // PrepareForShutdown indicates an expected call of PrepareForShutdown. 348 func (mr *MockServerInfoSourceMockRecorder) PrepareForShutdown() *gomock.Call { 349 mr.mock.ctrl.T.Helper() 350 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrepareForShutdown", reflect.TypeOf((*MockServerInfoSource)(nil).PrepareForShutdown)) 351 } 352 353 // Provisioning mocks base method. 354 func (m *MockServerInfoSource) Provisioning() bool { 355 m.ctrl.T.Helper() 356 ret := m.ctrl.Call(m, "Provisioning") 357 ret0, _ := ret[0].(bool) 358 return ret0 359 } 360 361 // Provisioning indicates an expected call of Provisioning. 362 func (mr *MockServerInfoSourceMockRecorder) Provisioning() *gomock.Call { 363 mr.mock.ctrl.T.Helper() 364 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Provisioning", reflect.TypeOf((*MockServerInfoSource)(nil).Provisioning)) 365 } 366 367 // StartTime mocks base method. 368 func (m *MockServerInfoSource) StartTime() time.Time { 369 m.ctrl.T.Helper() 370 ret := m.ctrl.Call(m, "StartTime") 371 ret0, _ := ret[0].(time.Time) 372 return ret0 373 } 374 375 // StartTime indicates an expected call of StartTime. 376 func (mr *MockServerInfoSourceMockRecorder) StartTime() *gomock.Call { 377 mr.mock.ctrl.T.Helper() 378 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartTime", reflect.TypeOf((*MockServerInfoSource)(nil).StartTime)) 379 } 380 381 // Stats mocks base method. 382 func (m *MockServerInfoSource) Stats() statistics.ServerStats { 383 m.ctrl.T.Helper() 384 ret := m.ctrl.Call(m, "Stats") 385 ret0, _ := ret[0].(statistics.ServerStats) 386 return ret0 387 } 388 389 // Stats indicates an expected call of Stats. 390 func (mr *MockServerInfoSourceMockRecorder) Stats() *gomock.Call { 391 mr.mock.ctrl.T.Helper() 392 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stats", reflect.TypeOf((*MockServerInfoSource)(nil).Stats)) 393 } 394 395 // UpTime mocks base method. 396 func (m *MockServerInfoSource) UpTime() int64 { 397 m.ctrl.T.Helper() 398 ret := m.ctrl.Call(m, "UpTime") 399 ret0, _ := ret[0].(int64) 400 return ret0 401 } 402 403 // UpTime indicates an expected call of UpTime. 404 func (mr *MockServerInfoSourceMockRecorder) UpTime() *gomock.Call { 405 mr.mock.ctrl.T.Helper() 406 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpTime", reflect.TypeOf((*MockServerInfoSource)(nil).UpTime)) 407 }