Files
grafana/pkg/registry/apis/provisioning/controller/finalizer_mock.go
T
Costa Alexoglou 1b766b9c9f Provisioning finalisers fix 2 (#111679)
* adding some logs to better understand what might be happening

* only focus this PR on improve logging in finalizer handling

* debug log before calling finalizers

* working on finalizers

* removing last todos, adding unit tests

* better use SupportedFinalizers name

* addressing comments

* wip: fix tests and add delete error in status

* chore: codegen

* chore: codegen openapi

* Merge remote-tracking branch 'origin/main' into provisioning-finalisers-fix-2

* update frontend client

* fix: errors in testing

* fix: breaking test

---------

Co-authored-by: Daniele Ferru <daniele.ferru@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-09-29 15:21:12 +02:00

86 lines
2.7 KiB
Go

// Code generated by mockery v2.53.4. DO NOT EDIT.
package controller
import (
context "context"
repository "github.com/grafana/grafana/apps/provisioning/pkg/repository"
mock "github.com/stretchr/testify/mock"
)
// MockFinalizerProcessor is an autogenerated mock type for the finalizerProcessor type
type MockFinalizerProcessor struct {
mock.Mock
}
type MockFinalizerProcessor_Expecter struct {
mock *mock.Mock
}
func (_m *MockFinalizerProcessor) EXPECT() *MockFinalizerProcessor_Expecter {
return &MockFinalizerProcessor_Expecter{mock: &_m.Mock}
}
// process provides a mock function with given fields: ctx, repo, finalizers
func (_m *MockFinalizerProcessor) process(ctx context.Context, repo repository.Repository, finalizers []string) error {
ret := _m.Called(ctx, repo, finalizers)
if len(ret) == 0 {
panic("no return value specified for process")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, repository.Repository, []string) error); ok {
r0 = rf(ctx, repo, finalizers)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockFinalizerProcessor_process_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'process'
type MockFinalizerProcessor_process_Call struct {
*mock.Call
}
// process is a helper method to define mock.On call
// - ctx context.Context
// - repo repository.Repository
// - finalizers []string
func (_e *MockFinalizerProcessor_Expecter) process(ctx interface{}, repo interface{}, finalizers interface{}) *MockFinalizerProcessor_process_Call {
return &MockFinalizerProcessor_process_Call{Call: _e.mock.On("process", ctx, repo, finalizers)}
}
func (_c *MockFinalizerProcessor_process_Call) Run(run func(ctx context.Context, repo repository.Repository, finalizers []string)) *MockFinalizerProcessor_process_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(repository.Repository), args[2].([]string))
})
return _c
}
func (_c *MockFinalizerProcessor_process_Call) Return(_a0 error) *MockFinalizerProcessor_process_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockFinalizerProcessor_process_Call) RunAndReturn(run func(context.Context, repository.Repository, []string) error) *MockFinalizerProcessor_process_Call {
_c.Call.Return(run)
return _c
}
// NewMockFinalizerProcessor creates a new instance of MockFinalizerProcessor. 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 NewMockFinalizerProcessor(t interface {
mock.TestingT
Cleanup(func())
}) *MockFinalizerProcessor {
mock := &MockFinalizerProcessor{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}