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

import (
	"sync"
	"time"

	"code.cloudfoundry.org/guardian/gardener"
)

type FakeSleeper struct {
	Stub        func(time.Duration)
	mutex       sync.RWMutex
	argsForCall []struct {
		arg1 time.Duration
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeSleeper) Spy(arg1 time.Duration) {
	fake.mutex.Lock()
	fake.argsForCall = append(fake.argsForCall, struct {
		arg1 time.Duration
	}{arg1})
	stub := fake.Stub
	fake.recordInvocation("Sleeper", []interface{}{arg1})
	fake.mutex.Unlock()
	if stub != nil {
		fake.Stub(arg1)
	}
}

func (fake *FakeSleeper) CallCount() int {
	fake.mutex.RLock()
	defer fake.mutex.RUnlock()
	return len(fake.argsForCall)
}

func (fake *FakeSleeper) Calls(stub func(time.Duration)) {
	fake.mutex.Lock()
	defer fake.mutex.Unlock()
	fake.Stub = stub
}

func (fake *FakeSleeper) ArgsForCall(i int) time.Duration {
	fake.mutex.RLock()
	defer fake.mutex.RUnlock()
	return fake.argsForCall[i].arg1
}

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

func (fake *FakeSleeper) 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 _ gardener.Sleeper = new(FakeSleeper).Spy
