// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package mockpbconnectca

import (
	"context"

	"github.com/hashicorp/consul/proto-public/pbconnectca"
	mock "github.com/stretchr/testify/mock"
	"google.golang.org/grpc"
)

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

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

	return mock
}

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

type ConnectCAServiceServer_Expecter struct {
	mock *mock.Mock
}

func (_m *ConnectCAServiceServer) EXPECT() *ConnectCAServiceServer_Expecter {
	return &ConnectCAServiceServer_Expecter{mock: &_m.Mock}
}

// Sign provides a mock function for the type ConnectCAServiceServer
func (_mock *ConnectCAServiceServer) Sign(context1 context.Context, signRequest *pbconnectca.SignRequest) (*pbconnectca.SignResponse, error) {
	ret := _mock.Called(context1, signRequest)

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

	var r0 *pbconnectca.SignResponse
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *pbconnectca.SignRequest) (*pbconnectca.SignResponse, error)); ok {
		return returnFunc(context1, signRequest)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *pbconnectca.SignRequest) *pbconnectca.SignResponse); ok {
		r0 = returnFunc(context1, signRequest)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*pbconnectca.SignResponse)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *pbconnectca.SignRequest) error); ok {
		r1 = returnFunc(context1, signRequest)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// ConnectCAServiceServer_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign'
type ConnectCAServiceServer_Sign_Call struct {
	*mock.Call
}

// Sign is a helper method to define mock.On call
//   - context1 context.Context
//   - signRequest *pbconnectca.SignRequest
func (_e *ConnectCAServiceServer_Expecter) Sign(context1 interface{}, signRequest interface{}) *ConnectCAServiceServer_Sign_Call {
	return &ConnectCAServiceServer_Sign_Call{Call: _e.mock.On("Sign", context1, signRequest)}
}

func (_c *ConnectCAServiceServer_Sign_Call) Run(run func(context1 context.Context, signRequest *pbconnectca.SignRequest)) *ConnectCAServiceServer_Sign_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *pbconnectca.SignRequest
		if args[1] != nil {
			arg1 = args[1].(*pbconnectca.SignRequest)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *ConnectCAServiceServer_Sign_Call) Return(signResponse *pbconnectca.SignResponse, err error) *ConnectCAServiceServer_Sign_Call {
	_c.Call.Return(signResponse, err)
	return _c
}

func (_c *ConnectCAServiceServer_Sign_Call) RunAndReturn(run func(context1 context.Context, signRequest *pbconnectca.SignRequest) (*pbconnectca.SignResponse, error)) *ConnectCAServiceServer_Sign_Call {
	_c.Call.Return(run)
	return _c
}

// WatchRoots provides a mock function for the type ConnectCAServiceServer
func (_mock *ConnectCAServiceServer) WatchRoots(watchRootsRequest *pbconnectca.WatchRootsRequest, serverStreamingServer grpc.ServerStreamingServer[pbconnectca.WatchRootsResponse]) error {
	ret := _mock.Called(watchRootsRequest, serverStreamingServer)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(*pbconnectca.WatchRootsRequest, grpc.ServerStreamingServer[pbconnectca.WatchRootsResponse]) error); ok {
		r0 = returnFunc(watchRootsRequest, serverStreamingServer)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

// ConnectCAServiceServer_WatchRoots_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRoots'
type ConnectCAServiceServer_WatchRoots_Call struct {
	*mock.Call
}

// WatchRoots is a helper method to define mock.On call
//   - watchRootsRequest *pbconnectca.WatchRootsRequest
//   - serverStreamingServer grpc.ServerStreamingServer[pbconnectca.WatchRootsResponse]
func (_e *ConnectCAServiceServer_Expecter) WatchRoots(watchRootsRequest interface{}, serverStreamingServer interface{}) *ConnectCAServiceServer_WatchRoots_Call {
	return &ConnectCAServiceServer_WatchRoots_Call{Call: _e.mock.On("WatchRoots", watchRootsRequest, serverStreamingServer)}
}

func (_c *ConnectCAServiceServer_WatchRoots_Call) Run(run func(watchRootsRequest *pbconnectca.WatchRootsRequest, serverStreamingServer grpc.ServerStreamingServer[pbconnectca.WatchRootsResponse])) *ConnectCAServiceServer_WatchRoots_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 *pbconnectca.WatchRootsRequest
		if args[0] != nil {
			arg0 = args[0].(*pbconnectca.WatchRootsRequest)
		}
		var arg1 grpc.ServerStreamingServer[pbconnectca.WatchRootsResponse]
		if args[1] != nil {
			arg1 = args[1].(grpc.ServerStreamingServer[pbconnectca.WatchRootsResponse])
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *ConnectCAServiceServer_WatchRoots_Call) Return(err error) *ConnectCAServiceServer_WatchRoots_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *ConnectCAServiceServer_WatchRoots_Call) RunAndReturn(run func(watchRootsRequest *pbconnectca.WatchRootsRequest, serverStreamingServer grpc.ServerStreamingServer[pbconnectca.WatchRootsResponse]) error) *ConnectCAServiceServer_WatchRoots_Call {
	_c.Call.Return(run)
	return _c
}
