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

import (
	"sync"

	"github.com/cloudfoundry/cloud-service-broker/v2/pkg/providers/tf/executor"
	version "github.com/hashicorp/go-version"
)

type FakeExecutorBuilder struct {
	VersionedExecutorStub        func(*version.Version) executor.TerraformExecutor
	versionedExecutorMutex       sync.RWMutex
	versionedExecutorArgsForCall []struct {
		arg1 *version.Version
	}
	versionedExecutorReturns struct {
		result1 executor.TerraformExecutor
	}
	versionedExecutorReturnsOnCall map[int]struct {
		result1 executor.TerraformExecutor
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeExecutorBuilder) VersionedExecutor(arg1 *version.Version) executor.TerraformExecutor {
	fake.versionedExecutorMutex.Lock()
	ret, specificReturn := fake.versionedExecutorReturnsOnCall[len(fake.versionedExecutorArgsForCall)]
	fake.versionedExecutorArgsForCall = append(fake.versionedExecutorArgsForCall, struct {
		arg1 *version.Version
	}{arg1})
	stub := fake.VersionedExecutorStub
	fakeReturns := fake.versionedExecutorReturns
	fake.recordInvocation("VersionedExecutor", []interface{}{arg1})
	fake.versionedExecutorMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeExecutorBuilder) VersionedExecutorCallCount() int {
	fake.versionedExecutorMutex.RLock()
	defer fake.versionedExecutorMutex.RUnlock()
	return len(fake.versionedExecutorArgsForCall)
}

func (fake *FakeExecutorBuilder) VersionedExecutorCalls(stub func(*version.Version) executor.TerraformExecutor) {
	fake.versionedExecutorMutex.Lock()
	defer fake.versionedExecutorMutex.Unlock()
	fake.VersionedExecutorStub = stub
}

func (fake *FakeExecutorBuilder) VersionedExecutorArgsForCall(i int) *version.Version {
	fake.versionedExecutorMutex.RLock()
	defer fake.versionedExecutorMutex.RUnlock()
	argsForCall := fake.versionedExecutorArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeExecutorBuilder) VersionedExecutorReturns(result1 executor.TerraformExecutor) {
	fake.versionedExecutorMutex.Lock()
	defer fake.versionedExecutorMutex.Unlock()
	fake.VersionedExecutorStub = nil
	fake.versionedExecutorReturns = struct {
		result1 executor.TerraformExecutor
	}{result1}
}

func (fake *FakeExecutorBuilder) VersionedExecutorReturnsOnCall(i int, result1 executor.TerraformExecutor) {
	fake.versionedExecutorMutex.Lock()
	defer fake.versionedExecutorMutex.Unlock()
	fake.VersionedExecutorStub = nil
	if fake.versionedExecutorReturnsOnCall == nil {
		fake.versionedExecutorReturnsOnCall = make(map[int]struct {
			result1 executor.TerraformExecutor
		})
	}
	fake.versionedExecutorReturnsOnCall[i] = struct {
		result1 executor.TerraformExecutor
	}{result1}
}

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

func (fake *FakeExecutorBuilder) 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 _ executor.ExecutorBuilder = new(FakeExecutorBuilder)
