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

package mocks

import (
	context "context"

	biz "github.com/chainloop-dev/chainloop/app/controlplane/pkg/biz"

	mock "github.com/stretchr/testify/mock"

	uuid "github.com/google/uuid"
)

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

// Create provides a mock function with given fields: ctx, digest, casBackendID, opts
func (_m *CASMappingRepo) Create(ctx context.Context, digest string, casBackendID uuid.UUID, opts *biz.CASMappingCreateOpts) (*biz.CASMapping, error) {
	ret := _m.Called(ctx, digest, casBackendID, opts)

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

	var r0 *biz.CASMapping
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, uuid.UUID, *biz.CASMappingCreateOpts) (*biz.CASMapping, error)); ok {
		return rf(ctx, digest, casBackendID, opts)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, uuid.UUID, *biz.CASMappingCreateOpts) *biz.CASMapping); ok {
		r0 = rf(ctx, digest, casBackendID, opts)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*biz.CASMapping)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, string, uuid.UUID, *biz.CASMappingCreateOpts) error); ok {
		r1 = rf(ctx, digest, casBackendID, opts)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// FindByDigest provides a mock function with given fields: ctx, digest
func (_m *CASMappingRepo) FindByDigest(ctx context.Context, digest string) ([]*biz.CASMapping, error) {
	ret := _m.Called(ctx, digest)

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

	var r0 []*biz.CASMapping
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string) ([]*biz.CASMapping, error)); ok {
		return rf(ctx, digest)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string) []*biz.CASMapping); ok {
		r0 = rf(ctx, digest)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]*biz.CASMapping)
		}
	}

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

	return r0, r1
}

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

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

	return mock
}
