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

import (
	"sync"

	"github.com/cloudfoundry/bosh-cli/v7/deployment/template"
)

type FakeDeploymentTemplateFactory struct {
	NewDeploymentTemplateFromPathStub        func(string) (template.DeploymentTemplate, error)
	newDeploymentTemplateFromPathMutex       sync.RWMutex
	newDeploymentTemplateFromPathArgsForCall []struct {
		arg1 string
	}
	newDeploymentTemplateFromPathReturns struct {
		result1 template.DeploymentTemplate
		result2 error
	}
	newDeploymentTemplateFromPathReturnsOnCall map[int]struct {
		result1 template.DeploymentTemplate
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeDeploymentTemplateFactory) NewDeploymentTemplateFromPath(arg1 string) (template.DeploymentTemplate, error) {
	fake.newDeploymentTemplateFromPathMutex.Lock()
	ret, specificReturn := fake.newDeploymentTemplateFromPathReturnsOnCall[len(fake.newDeploymentTemplateFromPathArgsForCall)]
	fake.newDeploymentTemplateFromPathArgsForCall = append(fake.newDeploymentTemplateFromPathArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.NewDeploymentTemplateFromPathStub
	fakeReturns := fake.newDeploymentTemplateFromPathReturns
	fake.recordInvocation("NewDeploymentTemplateFromPath", []interface{}{arg1})
	fake.newDeploymentTemplateFromPathMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeDeploymentTemplateFactory) NewDeploymentTemplateFromPathCallCount() int {
	fake.newDeploymentTemplateFromPathMutex.RLock()
	defer fake.newDeploymentTemplateFromPathMutex.RUnlock()
	return len(fake.newDeploymentTemplateFromPathArgsForCall)
}

func (fake *FakeDeploymentTemplateFactory) NewDeploymentTemplateFromPathCalls(stub func(string) (template.DeploymentTemplate, error)) {
	fake.newDeploymentTemplateFromPathMutex.Lock()
	defer fake.newDeploymentTemplateFromPathMutex.Unlock()
	fake.NewDeploymentTemplateFromPathStub = stub
}

func (fake *FakeDeploymentTemplateFactory) NewDeploymentTemplateFromPathArgsForCall(i int) string {
	fake.newDeploymentTemplateFromPathMutex.RLock()
	defer fake.newDeploymentTemplateFromPathMutex.RUnlock()
	argsForCall := fake.newDeploymentTemplateFromPathArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeDeploymentTemplateFactory) NewDeploymentTemplateFromPathReturns(result1 template.DeploymentTemplate, result2 error) {
	fake.newDeploymentTemplateFromPathMutex.Lock()
	defer fake.newDeploymentTemplateFromPathMutex.Unlock()
	fake.NewDeploymentTemplateFromPathStub = nil
	fake.newDeploymentTemplateFromPathReturns = struct {
		result1 template.DeploymentTemplate
		result2 error
	}{result1, result2}
}

func (fake *FakeDeploymentTemplateFactory) NewDeploymentTemplateFromPathReturnsOnCall(i int, result1 template.DeploymentTemplate, result2 error) {
	fake.newDeploymentTemplateFromPathMutex.Lock()
	defer fake.newDeploymentTemplateFromPathMutex.Unlock()
	fake.NewDeploymentTemplateFromPathStub = nil
	if fake.newDeploymentTemplateFromPathReturnsOnCall == nil {
		fake.newDeploymentTemplateFromPathReturnsOnCall = make(map[int]struct {
			result1 template.DeploymentTemplate
			result2 error
		})
	}
	fake.newDeploymentTemplateFromPathReturnsOnCall[i] = struct {
		result1 template.DeploymentTemplate
		result2 error
	}{result1, result2}
}

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

func (fake *FakeDeploymentTemplateFactory) 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 _ template.DeploymentTemplateFactory = new(FakeDeploymentTemplateFactory)
