diff options
author | gururajarao79 <gb00566633@techmahindra.com> | 2024-11-22 14:28:41 +0100 |
---|---|---|
committer | gururajarao79 <gb00566633@techmahindra.com> | 2024-11-27 13:26:18 +0100 |
commit | 542b9d143da57bcb3894f730c9ca2200aa7b89cb (patch) | |
tree | b72c52f5bc3aad77c82600b8541d6db2a55ef651 /pkg/kafkacomm/mocks | |
parent | 55772eebb9ec2bb12cd16e5c2531dceb0860ad5b (diff) |
For details on scope and implementation, please check.
https://lf-onap.atlassian.net/wiki/spaces/DW/pages/51150925/OPA+PDP
Code Coverage Total: 70.8%
Issue-ID: POLICY-5156
Change-Id: Ied07ee1596e9f447183fb715baaa68c704a9fe99
Signed-off-by: gururajarao79 <gb00566633@techmahindra.com>
Diffstat (limited to 'pkg/kafkacomm/mocks')
-rw-r--r-- | pkg/kafkacomm/mocks/kafkaconsumerinterface.go | 96 | ||||
-rw-r--r-- | pkg/kafkacomm/mocks/kafkaproducerinterface.go | 51 |
2 files changed, 147 insertions, 0 deletions
diff --git a/pkg/kafkacomm/mocks/kafkaconsumerinterface.go b/pkg/kafkacomm/mocks/kafkaconsumerinterface.go new file mode 100644 index 0000000..ca5140e --- /dev/null +++ b/pkg/kafkacomm/mocks/kafkaconsumerinterface.go @@ -0,0 +1,96 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + kafka "github.com/confluentinc/confluent-kafka-go/kafka" + + mock "github.com/stretchr/testify/mock" + + time "time" +) + +// KafkaConsumerInterface is an autogenerated mock type for the KafkaConsumerInterface type +type KafkaConsumerInterface struct { + mock.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 +} + +// 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 +} + +// Unsubscribe provides a mock function with given fields: +func (_m *KafkaConsumerInterface) Unsubscribe() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Unsubscribe") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// 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 +} diff --git a/pkg/kafkacomm/mocks/kafkaproducerinterface.go b/pkg/kafkacomm/mocks/kafkaproducerinterface.go new file mode 100644 index 0000000..97b6f53 --- /dev/null +++ b/pkg/kafkacomm/mocks/kafkaproducerinterface.go @@ -0,0 +1,51 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + kafka "github.com/confluentinc/confluent-kafka-go/kafka" + + mock "github.com/stretchr/testify/mock" +) + +// KafkaProducerInterface is an autogenerated mock type for the KafkaProducerInterface type +type KafkaProducerInterface struct { + mock.Mock +} + +// Close provides a mock function with given fields: +func (_m *KafkaProducerInterface) Close() { + _m.Called() +} + +// Produce provides a mock function with given fields: _a0, _a1 +func (_m *KafkaProducerInterface) Produce(_a0 *kafka.Message, _a1 chan kafka.Event) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Produce") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*kafka.Message, chan kafka.Event) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// NewKafkaProducerInterface creates a new instance of KafkaProducerInterface. 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 NewKafkaProducerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *KafkaProducerInterface { + mock := &KafkaProducerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} |