
// Code generated by mockery v2.53.5. DO NOT EDIT.

package mocks

import (
	context "context"

	stream "github.com/mendersoftware/mender-server/pkg/stream"
	mock "github.com/stretchr/testify/mock"
)

// Listener is an autogenerated mock type for the Listener type
type Listener struct {
	mock.Mock
}

// Accept provides a mock function with given fields: ctx
func (_m *Listener) Accept(ctx context.Context) (stream.Conn, error) {
	ret := _m.Called(ctx)

	if len(ret) == 0 {
		panic("no return value specified for Accept")
	}

	var r0 stream.Conn
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context) (stream.Conn, error)); ok {
		return rf(ctx)
	}
	if rf, ok := ret.Get(0).(func(context.Context) stream.Conn); ok {
		r0 = rf(ctx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(stream.Conn)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
		r1 = rf(ctx)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Close provides a mock function with given fields: ctx
func (_m *Listener) Close(ctx context.Context) error {
	ret := _m.Called(ctx)

	if len(ret) == 0 {
		panic("no return value specified for Close")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
		r0 = rf(ctx)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// LocalAddr provides a mock function with no fields
func (_m *Listener) LocalAddr() string {
	ret := _m.Called()

	if len(ret) == 0 {
		panic("no return value specified for LocalAddr")
	}

	var r0 string
	if rf, ok := ret.Get(0).(func() string); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// NewListener creates a new instance of Listener. 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 NewListener(t interface {
	mock.TestingT
	Cleanup(func())
}) *Listener {
	mock := &Listener{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
