consul/agent/dns/mock_DNSRouter.go

83 lines
2.0 KiB
Go

// Code generated by mockery v2.32.4. DO NOT EDIT.
package dns
import (
config "github.com/hashicorp/consul/agent/config"
miekgdns "github.com/miekg/dns"
mock "github.com/stretchr/testify/mock"
net "net"
)
// MockDNSRouter is an autogenerated mock type for the DNSRouter type
type MockDNSRouter struct {
mock.Mock
}
// GetConfig provides a mock function with given fields:
func (_m *MockDNSRouter) GetConfig() *RouterDynamicConfig {
ret := _m.Called()
var r0 *RouterDynamicConfig
if rf, ok := ret.Get(0).(func() *RouterDynamicConfig); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*RouterDynamicConfig)
}
}
return r0
}
// HandleRequest provides a mock function with given fields: req, reqCtx, remoteAddress
func (_m *MockDNSRouter) HandleRequest(req *miekgdns.Msg, reqCtx Context, remoteAddress net.Addr) *miekgdns.Msg {
ret := _m.Called(req, reqCtx, remoteAddress)
var r0 *miekgdns.Msg
if rf, ok := ret.Get(0).(func(*miekgdns.Msg, Context, net.Addr) *miekgdns.Msg); ok {
r0 = rf(req, reqCtx, remoteAddress)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*miekgdns.Msg)
}
}
return r0
}
// ReloadConfig provides a mock function with given fields: newCfg
func (_m *MockDNSRouter) ReloadConfig(newCfg *config.RuntimeConfig) error {
ret := _m.Called(newCfg)
var r0 error
if rf, ok := ret.Get(0).(func(*config.RuntimeConfig) error); ok {
r0 = rf(newCfg)
} else {
r0 = ret.Error(0)
}
return r0
}
// ServeDNS provides a mock function with given fields: w, req
func (_m *MockDNSRouter) ServeDNS(w miekgdns.ResponseWriter, req *miekgdns.Msg) {
_m.Called(w, req)
}
// NewMockDNSRouter creates a new instance of MockDNSRouter. 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 NewMockDNSRouter(t interface {
mock.TestingT
Cleanup(func())
}) *MockDNSRouter {
mock := &MockDNSRouter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}