// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq

package fake

import (
	"context"
	corev1 "k8s.io/api/core/v1"
	"sync"
)

// MockHandler is a mock implementation of handlers.K8sHandler.
//
//	func TestSomethingThatUsesK8sHandler(t *testing.T) {
//
//		// make and configure a mocked handlers.K8sHandler
//		mockedK8sHandler := &MockHandler{
//			HandleFunc: func(ctx context.Context, pod *corev1.Pod, namespace string) error {
//				panic("mock out the Handle method")
//			},
//		}
//
//		// use mockedK8sHandler in code that requires handlers.K8sHandler
//		// and then make assertions.
//
//	}
type MockHandler struct {
	// HandleFunc mocks the Handle method.
	HandleFunc func(ctx context.Context, pod *corev1.Pod, namespace string) error

	// calls tracks calls to the methods.
	calls struct {
		// Handle holds details about calls to the Handle method.
		Handle []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Pod is the pod argument value.
			Pod *corev1.Pod
			// Namespace is the namespace argument value.
			Namespace string
		}
	}
	lockHandle sync.RWMutex
}

// Handle calls HandleFunc.
func (mock *MockHandler) Handle(ctx context.Context, pod *corev1.Pod, namespace string) error {
	if mock.HandleFunc == nil {
		panic("MockHandler.HandleFunc: method is nil but K8sHandler.Handle was just called")
	}
	callInfo := struct {
		Ctx       context.Context
		Pod       *corev1.Pod
		Namespace string
	}{
		Ctx:       ctx,
		Pod:       pod,
		Namespace: namespace,
	}
	mock.lockHandle.Lock()
	mock.calls.Handle = append(mock.calls.Handle, callInfo)
	mock.lockHandle.Unlock()
	return mock.HandleFunc(ctx, pod, namespace)
}

// HandleCalls gets all the calls that were made to Handle.
// Check the length with:
//
//	len(mockedK8sHandler.HandleCalls())
func (mock *MockHandler) HandleCalls() []struct {
	Ctx       context.Context
	Pod       *corev1.Pod
	Namespace string
} {
	var calls []struct {
		Ctx       context.Context
		Pod       *corev1.Pod
		Namespace string
	}
	mock.lockHandle.RLock()
	calls = mock.calls.Handle
	mock.lockHandle.RUnlock()
	return calls
}
