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

import (
	"sync"

	"code.cloudfoundry.org/guardian/rundmc/runrunc"
	"code.cloudfoundry.org/lager/v3"
)

type FakeWaitWatcher struct {
	OnExitStub        func(lager.Logger, runrunc.Waiter, runrunc.Runner)
	onExitMutex       sync.RWMutex
	onExitArgsForCall []struct {
		arg1 lager.Logger
		arg2 runrunc.Waiter
		arg3 runrunc.Runner
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeWaitWatcher) OnExit(arg1 lager.Logger, arg2 runrunc.Waiter, arg3 runrunc.Runner) {
	fake.onExitMutex.Lock()
	fake.onExitArgsForCall = append(fake.onExitArgsForCall, struct {
		arg1 lager.Logger
		arg2 runrunc.Waiter
		arg3 runrunc.Runner
	}{arg1, arg2, arg3})
	fake.recordInvocation("OnExit", []interface{}{arg1, arg2, arg3})
	fake.onExitMutex.Unlock()
	if fake.OnExitStub != nil {
		fake.OnExitStub(arg1, arg2, arg3)
	}
}

func (fake *FakeWaitWatcher) OnExitCallCount() int {
	fake.onExitMutex.RLock()
	defer fake.onExitMutex.RUnlock()
	return len(fake.onExitArgsForCall)
}

func (fake *FakeWaitWatcher) OnExitCalls(stub func(lager.Logger, runrunc.Waiter, runrunc.Runner)) {
	fake.onExitMutex.Lock()
	defer fake.onExitMutex.Unlock()
	fake.OnExitStub = stub
}

func (fake *FakeWaitWatcher) OnExitArgsForCall(i int) (lager.Logger, runrunc.Waiter, runrunc.Runner) {
	fake.onExitMutex.RLock()
	defer fake.onExitMutex.RUnlock()
	argsForCall := fake.onExitArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

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

func (fake *FakeWaitWatcher) 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 _ runrunc.WaitWatcher = new(FakeWaitWatcher)
