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

import (
	"sync"

	"github.com/cloudfoundry/bosh-agent/agent/script"
	"github.com/cloudfoundry/bosh-agent/agent/script/drain"
)

type FakeJobScriptProvider struct {
	NewDrainScriptStub        func(string, drain.ScriptParams) script.CancellableScript
	newDrainScriptMutex       sync.RWMutex
	newDrainScriptArgsForCall []struct {
		arg1 string
		arg2 drain.ScriptParams
	}
	newDrainScriptReturns struct {
		result1 script.CancellableScript
	}
	newDrainScriptReturnsOnCall map[int]struct {
		result1 script.CancellableScript
	}
	NewParallelScriptStub        func(string, []script.Script) script.CancellableScript
	newParallelScriptMutex       sync.RWMutex
	newParallelScriptArgsForCall []struct {
		arg1 string
		arg2 []script.Script
	}
	newParallelScriptReturns struct {
		result1 script.CancellableScript
	}
	newParallelScriptReturnsOnCall map[int]struct {
		result1 script.CancellableScript
	}
	NewScriptStub        func(string, string, map[string]string) script.Script
	newScriptMutex       sync.RWMutex
	newScriptArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 map[string]string
	}
	newScriptReturns struct {
		result1 script.Script
	}
	newScriptReturnsOnCall map[int]struct {
		result1 script.Script
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeJobScriptProvider) NewDrainScript(arg1 string, arg2 drain.ScriptParams) script.CancellableScript {
	fake.newDrainScriptMutex.Lock()
	ret, specificReturn := fake.newDrainScriptReturnsOnCall[len(fake.newDrainScriptArgsForCall)]
	fake.newDrainScriptArgsForCall = append(fake.newDrainScriptArgsForCall, struct {
		arg1 string
		arg2 drain.ScriptParams
	}{arg1, arg2})
	fake.recordInvocation("NewDrainScript", []interface{}{arg1, arg2})
	fake.newDrainScriptMutex.Unlock()
	if fake.NewDrainScriptStub != nil {
		return fake.NewDrainScriptStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.newDrainScriptReturns
	return fakeReturns.result1
}

func (fake *FakeJobScriptProvider) NewDrainScriptCallCount() int {
	fake.newDrainScriptMutex.RLock()
	defer fake.newDrainScriptMutex.RUnlock()
	return len(fake.newDrainScriptArgsForCall)
}

func (fake *FakeJobScriptProvider) NewDrainScriptCalls(stub func(string, drain.ScriptParams) script.CancellableScript) {
	fake.newDrainScriptMutex.Lock()
	defer fake.newDrainScriptMutex.Unlock()
	fake.NewDrainScriptStub = stub
}

func (fake *FakeJobScriptProvider) NewDrainScriptArgsForCall(i int) (string, drain.ScriptParams) {
	fake.newDrainScriptMutex.RLock()
	defer fake.newDrainScriptMutex.RUnlock()
	argsForCall := fake.newDrainScriptArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeJobScriptProvider) NewDrainScriptReturns(result1 script.CancellableScript) {
	fake.newDrainScriptMutex.Lock()
	defer fake.newDrainScriptMutex.Unlock()
	fake.NewDrainScriptStub = nil
	fake.newDrainScriptReturns = struct {
		result1 script.CancellableScript
	}{result1}
}

func (fake *FakeJobScriptProvider) NewDrainScriptReturnsOnCall(i int, result1 script.CancellableScript) {
	fake.newDrainScriptMutex.Lock()
	defer fake.newDrainScriptMutex.Unlock()
	fake.NewDrainScriptStub = nil
	if fake.newDrainScriptReturnsOnCall == nil {
		fake.newDrainScriptReturnsOnCall = make(map[int]struct {
			result1 script.CancellableScript
		})
	}
	fake.newDrainScriptReturnsOnCall[i] = struct {
		result1 script.CancellableScript
	}{result1}
}

func (fake *FakeJobScriptProvider) NewParallelScript(arg1 string, arg2 []script.Script) script.CancellableScript {
	var arg2Copy []script.Script
	if arg2 != nil {
		arg2Copy = make([]script.Script, len(arg2))
		copy(arg2Copy, arg2)
	}
	fake.newParallelScriptMutex.Lock()
	ret, specificReturn := fake.newParallelScriptReturnsOnCall[len(fake.newParallelScriptArgsForCall)]
	fake.newParallelScriptArgsForCall = append(fake.newParallelScriptArgsForCall, struct {
		arg1 string
		arg2 []script.Script
	}{arg1, arg2Copy})
	fake.recordInvocation("NewParallelScript", []interface{}{arg1, arg2Copy})
	fake.newParallelScriptMutex.Unlock()
	if fake.NewParallelScriptStub != nil {
		return fake.NewParallelScriptStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.newParallelScriptReturns
	return fakeReturns.result1
}

func (fake *FakeJobScriptProvider) NewParallelScriptCallCount() int {
	fake.newParallelScriptMutex.RLock()
	defer fake.newParallelScriptMutex.RUnlock()
	return len(fake.newParallelScriptArgsForCall)
}

func (fake *FakeJobScriptProvider) NewParallelScriptCalls(stub func(string, []script.Script) script.CancellableScript) {
	fake.newParallelScriptMutex.Lock()
	defer fake.newParallelScriptMutex.Unlock()
	fake.NewParallelScriptStub = stub
}

func (fake *FakeJobScriptProvider) NewParallelScriptArgsForCall(i int) (string, []script.Script) {
	fake.newParallelScriptMutex.RLock()
	defer fake.newParallelScriptMutex.RUnlock()
	argsForCall := fake.newParallelScriptArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeJobScriptProvider) NewParallelScriptReturns(result1 script.CancellableScript) {
	fake.newParallelScriptMutex.Lock()
	defer fake.newParallelScriptMutex.Unlock()
	fake.NewParallelScriptStub = nil
	fake.newParallelScriptReturns = struct {
		result1 script.CancellableScript
	}{result1}
}

func (fake *FakeJobScriptProvider) NewParallelScriptReturnsOnCall(i int, result1 script.CancellableScript) {
	fake.newParallelScriptMutex.Lock()
	defer fake.newParallelScriptMutex.Unlock()
	fake.NewParallelScriptStub = nil
	if fake.newParallelScriptReturnsOnCall == nil {
		fake.newParallelScriptReturnsOnCall = make(map[int]struct {
			result1 script.CancellableScript
		})
	}
	fake.newParallelScriptReturnsOnCall[i] = struct {
		result1 script.CancellableScript
	}{result1}
}

func (fake *FakeJobScriptProvider) NewScript(arg1 string, arg2 string, arg3 map[string]string) script.Script {
	fake.newScriptMutex.Lock()
	ret, specificReturn := fake.newScriptReturnsOnCall[len(fake.newScriptArgsForCall)]
	fake.newScriptArgsForCall = append(fake.newScriptArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 map[string]string
	}{arg1, arg2, arg3})
	fake.recordInvocation("NewScript", []interface{}{arg1, arg2, arg3})
	fake.newScriptMutex.Unlock()
	if fake.NewScriptStub != nil {
		return fake.NewScriptStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.newScriptReturns
	return fakeReturns.result1
}

func (fake *FakeJobScriptProvider) NewScriptCallCount() int {
	fake.newScriptMutex.RLock()
	defer fake.newScriptMutex.RUnlock()
	return len(fake.newScriptArgsForCall)
}

func (fake *FakeJobScriptProvider) NewScriptCalls(stub func(string, string, map[string]string) script.Script) {
	fake.newScriptMutex.Lock()
	defer fake.newScriptMutex.Unlock()
	fake.NewScriptStub = stub
}

func (fake *FakeJobScriptProvider) NewScriptArgsForCall(i int) (string, string, map[string]string) {
	fake.newScriptMutex.RLock()
	defer fake.newScriptMutex.RUnlock()
	argsForCall := fake.newScriptArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeJobScriptProvider) NewScriptReturns(result1 script.Script) {
	fake.newScriptMutex.Lock()
	defer fake.newScriptMutex.Unlock()
	fake.NewScriptStub = nil
	fake.newScriptReturns = struct {
		result1 script.Script
	}{result1}
}

func (fake *FakeJobScriptProvider) NewScriptReturnsOnCall(i int, result1 script.Script) {
	fake.newScriptMutex.Lock()
	defer fake.newScriptMutex.Unlock()
	fake.NewScriptStub = nil
	if fake.newScriptReturnsOnCall == nil {
		fake.newScriptReturnsOnCall = make(map[int]struct {
			result1 script.Script
		})
	}
	fake.newScriptReturnsOnCall[i] = struct {
		result1 script.Script
	}{result1}
}

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

func (fake *FakeJobScriptProvider) 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 _ script.JobScriptProvider = new(FakeJobScriptProvider)
