Files
reproxy/app/discovery/provider/consulcatalog/consul_client_mock.go
2024-05-09 13:16:40 -05:00

64 lines
1.4 KiB
Go

// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package consulcatalog
import (
"sync"
)
// ConsulClientMock is a mock implementation of ConsulClient.
//
// func TestSomethingThatUsesConsulClient(t *testing.T) {
//
// // make and configure a mocked ConsulClient
// mockedConsulClient := &ConsulClientMock{
// GetFunc: func() ([]consulService, error) {
// panic("mock out the Get method")
// },
// }
//
// // use mockedConsulClient in code that requires ConsulClient
// // and then make assertions.
//
// }
type ConsulClientMock struct {
// GetFunc mocks the Get method.
GetFunc func() ([]consulService, error)
// calls tracks calls to the methods.
calls struct {
// Get holds details about calls to the Get method.
Get []struct {
}
}
lockGet sync.RWMutex
}
// Get calls GetFunc.
func (mock *ConsulClientMock) Get() ([]consulService, error) {
if mock.GetFunc == nil {
panic("ConsulClientMock.GetFunc: method is nil but ConsulClient.Get was just called")
}
callInfo := struct {
}{}
mock.lockGet.Lock()
mock.calls.Get = append(mock.calls.Get, callInfo)
mock.lockGet.Unlock()
return mock.GetFunc()
}
// GetCalls gets all the calls that were made to Get.
// Check the length with:
//
// len(mockedConsulClient.GetCalls())
func (mock *ConsulClientMock) GetCalls() []struct {
} {
var calls []struct {
}
mock.lockGet.RLock()
calls = mock.calls.Get
mock.lockGet.RUnlock()
return calls
}