mirror of https://github.com/hashicorp/consul
111 lines
3.3 KiB
Go
111 lines
3.3 KiB
Go
// Code generated by mockery v2.37.1. DO NOT EDIT.
|
|
|
|
package mockpbdns
|
|
|
|
import (
|
|
context "context"
|
|
|
|
grpc "google.golang.org/grpc"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
pbdns "github.com/hashicorp/consul/proto-public/pbdns"
|
|
)
|
|
|
|
// DNSServiceClient is an autogenerated mock type for the DNSServiceClient type
|
|
type DNSServiceClient struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type DNSServiceClient_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *DNSServiceClient) EXPECT() *DNSServiceClient_Expecter {
|
|
return &DNSServiceClient_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Query provides a mock function with given fields: ctx, in, opts
|
|
func (_m *DNSServiceClient) Query(ctx context.Context, in *pbdns.QueryRequest, opts ...grpc.CallOption) (*pbdns.QueryResponse, error) {
|
|
_va := make([]interface{}, len(opts))
|
|
for _i := range opts {
|
|
_va[_i] = opts[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, ctx, in)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
var r0 *pbdns.QueryResponse
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) (*pbdns.QueryResponse, error)); ok {
|
|
return rf(ctx, in, opts...)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) *pbdns.QueryResponse); ok {
|
|
r0 = rf(ctx, in, opts...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*pbdns.QueryResponse)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) error); ok {
|
|
r1 = rf(ctx, in, opts...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// DNSServiceClient_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query'
|
|
type DNSServiceClient_Query_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Query is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - in *pbdns.QueryRequest
|
|
// - opts ...grpc.CallOption
|
|
func (_e *DNSServiceClient_Expecter) Query(ctx interface{}, in interface{}, opts ...interface{}) *DNSServiceClient_Query_Call {
|
|
return &DNSServiceClient_Query_Call{Call: _e.mock.On("Query",
|
|
append([]interface{}{ctx, in}, opts...)...)}
|
|
}
|
|
|
|
func (_c *DNSServiceClient_Query_Call) Run(run func(ctx context.Context, in *pbdns.QueryRequest, opts ...grpc.CallOption)) *DNSServiceClient_Query_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
variadicArgs := make([]grpc.CallOption, len(args)-2)
|
|
for i, a := range args[2:] {
|
|
if a != nil {
|
|
variadicArgs[i] = a.(grpc.CallOption)
|
|
}
|
|
}
|
|
run(args[0].(context.Context), args[1].(*pbdns.QueryRequest), variadicArgs...)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *DNSServiceClient_Query_Call) Return(_a0 *pbdns.QueryResponse, _a1 error) *DNSServiceClient_Query_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *DNSServiceClient_Query_Call) RunAndReturn(run func(context.Context, *pbdns.QueryRequest, ...grpc.CallOption) (*pbdns.QueryResponse, error)) *DNSServiceClient_Query_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewDNSServiceClient creates a new instance of DNSServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewDNSServiceClient(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *DNSServiceClient {
|
|
mock := &DNSServiceClient{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|