2024-03-01 12:42:42 +00:00
// Code generated by mockery v2.32.4. DO NOT EDIT.
2024-01-22 15:10:03 +00:00
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
}
2024-03-01 12:42:42 +00:00
// 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
}
2024-01-22 15:10:03 +00:00
// HandleRequest provides a mock function with given fields: req, reqCtx, remoteAddress
2024-02-02 23:29:38 +00:00
func ( _m * MockDNSRouter ) HandleRequest ( req * miekgdns . Msg , reqCtx Context , remoteAddress net . Addr ) * miekgdns . Msg {
2024-01-22 15:10:03 +00:00
ret := _m . Called ( req , reqCtx , remoteAddress )
var r0 * miekgdns . Msg
2024-02-02 23:29:38 +00:00
if rf , ok := ret . Get ( 0 ) . ( func ( * miekgdns . Msg , Context , net . Addr ) * miekgdns . Msg ) ; ok {
2024-01-22 15:10:03 +00:00
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
}