// Code generated by counterfeiter. DO NOT EDIT.
package licensingfakes

import (
	"context"
	"sync"

	"github.com/nginx/nginx-gateway-fabric/v2/internal/controller/licensing"
	"github.com/nginx/nginx-gateway-fabric/v2/internal/controller/state/dataplane"
)

type FakeCollector struct {
	CollectStub        func(context.Context) (dataplane.DeploymentContext, error)
	collectMutex       sync.RWMutex
	collectArgsForCall []struct {
		arg1 context.Context
	}
	collectReturns struct {
		result1 dataplane.DeploymentContext
		result2 error
	}
	collectReturnsOnCall map[int]struct {
		result1 dataplane.DeploymentContext
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeCollector) Collect(arg1 context.Context) (dataplane.DeploymentContext, error) {
	fake.collectMutex.Lock()
	ret, specificReturn := fake.collectReturnsOnCall[len(fake.collectArgsForCall)]
	fake.collectArgsForCall = append(fake.collectArgsForCall, struct {
		arg1 context.Context
	}{arg1})
	stub := fake.CollectStub
	fakeReturns := fake.collectReturns
	fake.recordInvocation("Collect", []interface{}{arg1})
	fake.collectMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeCollector) CollectCallCount() int {
	fake.collectMutex.RLock()
	defer fake.collectMutex.RUnlock()
	return len(fake.collectArgsForCall)
}

func (fake *FakeCollector) CollectCalls(stub func(context.Context) (dataplane.DeploymentContext, error)) {
	fake.collectMutex.Lock()
	defer fake.collectMutex.Unlock()
	fake.CollectStub = stub
}

func (fake *FakeCollector) CollectArgsForCall(i int) context.Context {
	fake.collectMutex.RLock()
	defer fake.collectMutex.RUnlock()
	argsForCall := fake.collectArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeCollector) CollectReturns(result1 dataplane.DeploymentContext, result2 error) {
	fake.collectMutex.Lock()
	defer fake.collectMutex.Unlock()
	fake.CollectStub = nil
	fake.collectReturns = struct {
		result1 dataplane.DeploymentContext
		result2 error
	}{result1, result2}
}

func (fake *FakeCollector) CollectReturnsOnCall(i int, result1 dataplane.DeploymentContext, result2 error) {
	fake.collectMutex.Lock()
	defer fake.collectMutex.Unlock()
	fake.CollectStub = nil
	if fake.collectReturnsOnCall == nil {
		fake.collectReturnsOnCall = make(map[int]struct {
			result1 dataplane.DeploymentContext
			result2 error
		})
	}
	fake.collectReturnsOnCall[i] = struct {
		result1 dataplane.DeploymentContext
		result2 error
	}{result1, result2}
}

func (fake *FakeCollector) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeCollector) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ licensing.Collector = new(FakeCollector)
