// Copyright (c) Abstract Machines

// SPDX-License-Identifier: Apache-2.0

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

package mocks

import (
	"context"

	"github.com/absmach/magistrala/groups"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type Service_Expecter struct {
	mock *mock.Mock
}

func (_m *Service) EXPECT() *Service_Expecter {
	return &Service_Expecter{mock: &_m.Mock}
}

// RetrieveById provides a mock function for the type Service
func (_mock *Service) RetrieveById(ctx context.Context, id string) (groups.Group, error) {
	ret := _mock.Called(ctx, id)

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

	var r0 groups.Group
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (groups.Group, error)); ok {
		return returnFunc(ctx, id)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) groups.Group); ok {
		r0 = returnFunc(ctx, id)
	} else {
		r0 = ret.Get(0).(groups.Group)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = returnFunc(ctx, id)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// RetrieveById is a helper method to define mock.On call
//   - ctx context.Context
//   - id string
func (_e *Service_Expecter) RetrieveById(ctx interface{}, id interface{}) *Service_RetrieveById_Call {
	return &Service_RetrieveById_Call{Call: _e.mock.On("RetrieveById", ctx, id)}
}

func (_c *Service_RetrieveById_Call) Run(run func(ctx context.Context, id string)) *Service_RetrieveById_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Service_RetrieveById_Call) Return(group groups.Group, err error) *Service_RetrieveById_Call {
	_c.Call.Return(group, err)
	return _c
}

func (_c *Service_RetrieveById_Call) RunAndReturn(run func(ctx context.Context, id string) (groups.Group, error)) *Service_RetrieveById_Call {
	_c.Call.Return(run)
	return _c
}
