mirror of https://github.com/hashicorp/consul
168 lines
4.6 KiB
Go
168 lines
4.6 KiB
Go
// Code generated by mockery v2.15.0. DO NOT EDIT.
|
|
|
|
package hcp
|
|
|
|
import (
|
|
context "context"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// MockClient is an autogenerated mock type for the Client type
|
|
type MockClient struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockClient_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockClient) EXPECT() *MockClient_Expecter {
|
|
return &MockClient_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// DiscoverServers provides a mock function with given fields: ctx
|
|
func (_m *MockClient) DiscoverServers(ctx context.Context) ([]string, error) {
|
|
ret := _m.Called(ctx)
|
|
|
|
var r0 []string
|
|
if rf, ok := ret.Get(0).(func(context.Context) []string); ok {
|
|
r0 = rf(ctx)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]string)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
r1 = rf(ctx)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockClient_DiscoverServers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DiscoverServers'
|
|
type MockClient_DiscoverServers_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// DiscoverServers is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
func (_e *MockClient_Expecter) DiscoverServers(ctx interface{}) *MockClient_DiscoverServers_Call {
|
|
return &MockClient_DiscoverServers_Call{Call: _e.mock.On("DiscoverServers", ctx)}
|
|
}
|
|
|
|
func (_c *MockClient_DiscoverServers_Call) Run(run func(ctx context.Context)) *MockClient_DiscoverServers_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockClient_DiscoverServers_Call) Return(_a0 []string, _a1 error) *MockClient_DiscoverServers_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
// FetchBootstrap provides a mock function with given fields: ctx
|
|
func (_m *MockClient) FetchBootstrap(ctx context.Context) (*BootstrapConfig, error) {
|
|
ret := _m.Called(ctx)
|
|
|
|
var r0 *BootstrapConfig
|
|
if rf, ok := ret.Get(0).(func(context.Context) *BootstrapConfig); ok {
|
|
r0 = rf(ctx)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*BootstrapConfig)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
r1 = rf(ctx)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockClient_FetchBootstrap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchBootstrap'
|
|
type MockClient_FetchBootstrap_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// FetchBootstrap is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
func (_e *MockClient_Expecter) FetchBootstrap(ctx interface{}) *MockClient_FetchBootstrap_Call {
|
|
return &MockClient_FetchBootstrap_Call{Call: _e.mock.On("FetchBootstrap", ctx)}
|
|
}
|
|
|
|
func (_c *MockClient_FetchBootstrap_Call) Run(run func(ctx context.Context)) *MockClient_FetchBootstrap_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockClient_FetchBootstrap_Call) Return(_a0 *BootstrapConfig, _a1 error) *MockClient_FetchBootstrap_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
// PushServerStatus provides a mock function with given fields: ctx, status
|
|
func (_m *MockClient) PushServerStatus(ctx context.Context, status *ServerStatus) error {
|
|
ret := _m.Called(ctx, status)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *ServerStatus) error); ok {
|
|
r0 = rf(ctx, status)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockClient_PushServerStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushServerStatus'
|
|
type MockClient_PushServerStatus_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// PushServerStatus is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - status *ServerStatus
|
|
func (_e *MockClient_Expecter) PushServerStatus(ctx interface{}, status interface{}) *MockClient_PushServerStatus_Call {
|
|
return &MockClient_PushServerStatus_Call{Call: _e.mock.On("PushServerStatus", ctx, status)}
|
|
}
|
|
|
|
func (_c *MockClient_PushServerStatus_Call) Run(run func(ctx context.Context, status *ServerStatus)) *MockClient_PushServerStatus_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(*ServerStatus))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockClient_PushServerStatus_Call) Return(_a0 error) *MockClient_PushServerStatus_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
type mockConstructorTestingTNewMockClient interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewMockClient(t mockConstructorTestingTNewMockClient) *MockClient {
|
|
mock := &MockClient{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|