0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/livestream/mocks/KafkaConsumerInterface.go
2024-08-06 15:08:34 -07:00

188 lines
5.6 KiB
Go

// Code generated by mockery v2.44.1. DO NOT EDIT.
package mocks
import (
kafka "github.com/confluentinc/confluent-kafka-go/v2/kafka"
mock "github.com/stretchr/testify/mock"
time "time"
)
// KafkaConsumerInterface is an autogenerated mock type for the KafkaConsumerInterface type
type KafkaConsumerInterface struct {
mock.Mock
}
type KafkaConsumerInterface_Expecter struct {
mock *mock.Mock
}
func (_m *KafkaConsumerInterface) EXPECT() *KafkaConsumerInterface_Expecter {
return &KafkaConsumerInterface_Expecter{mock: &_m.Mock}
}
// Close provides a mock function with given fields:
func (_m *KafkaConsumerInterface) Close() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Close")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// KafkaConsumerInterface_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type KafkaConsumerInterface_Close_Call struct {
*mock.Call
}
// Close is a helper method to define mock.On call
func (_e *KafkaConsumerInterface_Expecter) Close() *KafkaConsumerInterface_Close_Call {
return &KafkaConsumerInterface_Close_Call{Call: _e.mock.On("Close")}
}
func (_c *KafkaConsumerInterface_Close_Call) Run(run func()) *KafkaConsumerInterface_Close_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *KafkaConsumerInterface_Close_Call) Return(_a0 error) *KafkaConsumerInterface_Close_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *KafkaConsumerInterface_Close_Call) RunAndReturn(run func() error) *KafkaConsumerInterface_Close_Call {
_c.Call.Return(run)
return _c
}
// ReadMessage provides a mock function with given fields: timeout
func (_m *KafkaConsumerInterface) ReadMessage(timeout time.Duration) (*kafka.Message, error) {
ret := _m.Called(timeout)
if len(ret) == 0 {
panic("no return value specified for ReadMessage")
}
var r0 *kafka.Message
var r1 error
if rf, ok := ret.Get(0).(func(time.Duration) (*kafka.Message, error)); ok {
return rf(timeout)
}
if rf, ok := ret.Get(0).(func(time.Duration) *kafka.Message); ok {
r0 = rf(timeout)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*kafka.Message)
}
}
if rf, ok := ret.Get(1).(func(time.Duration) error); ok {
r1 = rf(timeout)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// KafkaConsumerInterface_ReadMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadMessage'
type KafkaConsumerInterface_ReadMessage_Call struct {
*mock.Call
}
// ReadMessage is a helper method to define mock.On call
// - timeout time.Duration
func (_e *KafkaConsumerInterface_Expecter) ReadMessage(timeout interface{}) *KafkaConsumerInterface_ReadMessage_Call {
return &KafkaConsumerInterface_ReadMessage_Call{Call: _e.mock.On("ReadMessage", timeout)}
}
func (_c *KafkaConsumerInterface_ReadMessage_Call) Run(run func(timeout time.Duration)) *KafkaConsumerInterface_ReadMessage_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(time.Duration))
})
return _c
}
func (_c *KafkaConsumerInterface_ReadMessage_Call) Return(_a0 *kafka.Message, _a1 error) *KafkaConsumerInterface_ReadMessage_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *KafkaConsumerInterface_ReadMessage_Call) RunAndReturn(run func(time.Duration) (*kafka.Message, error)) *KafkaConsumerInterface_ReadMessage_Call {
_c.Call.Return(run)
return _c
}
// SubscribeTopics provides a mock function with given fields: topics, rebalanceCb
func (_m *KafkaConsumerInterface) SubscribeTopics(topics []string, rebalanceCb kafka.RebalanceCb) error {
ret := _m.Called(topics, rebalanceCb)
if len(ret) == 0 {
panic("no return value specified for SubscribeTopics")
}
var r0 error
if rf, ok := ret.Get(0).(func([]string, kafka.RebalanceCb) error); ok {
r0 = rf(topics, rebalanceCb)
} else {
r0 = ret.Error(0)
}
return r0
}
// KafkaConsumerInterface_SubscribeTopics_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeTopics'
type KafkaConsumerInterface_SubscribeTopics_Call struct {
*mock.Call
}
// SubscribeTopics is a helper method to define mock.On call
// - topics []string
// - rebalanceCb kafka.RebalanceCb
func (_e *KafkaConsumerInterface_Expecter) SubscribeTopics(topics interface{}, rebalanceCb interface{}) *KafkaConsumerInterface_SubscribeTopics_Call {
return &KafkaConsumerInterface_SubscribeTopics_Call{Call: _e.mock.On("SubscribeTopics", topics, rebalanceCb)}
}
func (_c *KafkaConsumerInterface_SubscribeTopics_Call) Run(run func(topics []string, rebalanceCb kafka.RebalanceCb)) *KafkaConsumerInterface_SubscribeTopics_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].([]string), args[1].(kafka.RebalanceCb))
})
return _c
}
func (_c *KafkaConsumerInterface_SubscribeTopics_Call) Return(_a0 error) *KafkaConsumerInterface_SubscribeTopics_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *KafkaConsumerInterface_SubscribeTopics_Call) RunAndReturn(run func([]string, kafka.RebalanceCb) error) *KafkaConsumerInterface_SubscribeTopics_Call {
_c.Call.Return(run)
return _c
}
// NewKafkaConsumerInterface creates a new instance of KafkaConsumerInterface. 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 NewKafkaConsumerInterface(t interface {
mock.TestingT
Cleanup(func())
}) *KafkaConsumerInterface {
mock := &KafkaConsumerInterface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}