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

package mocks

import (
	"context"
	"github.com/schmitthub/clawker/internal/controlplane"
	"sync"
)

// Ensure, that IntrospectorMock does implement controlplane.Introspector.
// If this is not the case, regenerate this file with moq.
var _ controlplane.Introspector = &IntrospectorMock{}

// IntrospectorMock is a mock implementation of controlplane.Introspector.
//
//	func TestSomethingThatUsesIntrospector(t *testing.T) {
//
//		// make and configure a mocked controlplane.Introspector
//		mockedIntrospector := &IntrospectorMock{
//			IntrospectFunc: func(ctx context.Context, token string, requiredScope string) (*controlplane.IntrospectionResult, error) {
//				panic("mock out the Introspect method")
//			},
//		}
//
//		// use mockedIntrospector in code that requires controlplane.Introspector
//		// and then make assertions.
//
//	}
type IntrospectorMock struct {
	// IntrospectFunc mocks the Introspect method.
	IntrospectFunc func(ctx context.Context, token string, requiredScope string) (*controlplane.IntrospectionResult, error)

	// calls tracks calls to the methods.
	calls struct {
		// Introspect holds details about calls to the Introspect method.
		Introspect []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Token is the token argument value.
			Token string
			// RequiredScope is the requiredScope argument value.
			RequiredScope string
		}
	}
	lockIntrospect sync.RWMutex
}

// Introspect calls IntrospectFunc.
func (mock *IntrospectorMock) Introspect(ctx context.Context, token string, requiredScope string) (*controlplane.IntrospectionResult, error) {
	if mock.IntrospectFunc == nil {
		panic("IntrospectorMock.IntrospectFunc: method is nil but Introspector.Introspect was just called")
	}
	callInfo := struct {
		Ctx           context.Context
		Token         string
		RequiredScope string
	}{
		Ctx:           ctx,
		Token:         token,
		RequiredScope: requiredScope,
	}
	mock.lockIntrospect.Lock()
	mock.calls.Introspect = append(mock.calls.Introspect, callInfo)
	mock.lockIntrospect.Unlock()
	return mock.IntrospectFunc(ctx, token, requiredScope)
}

// IntrospectCalls gets all the calls that were made to Introspect.
// Check the length with:
//
//	len(mockedIntrospector.IntrospectCalls())
func (mock *IntrospectorMock) IntrospectCalls() []struct {
	Ctx           context.Context
	Token         string
	RequiredScope string
} {
	var calls []struct {
		Ctx           context.Context
		Token         string
		RequiredScope string
	}
	mock.lockIntrospect.RLock()
	calls = mock.calls.Introspect
	mock.lockIntrospect.RUnlock()
	return calls
}
