// Code generated by counterfeiter. DO NOT EDIT.
//
//lint:file-ignore ST1008 Generated mocks reflect original interface signatures
package mocks

import (
	"context"
	"sync"

	"github.com/grafana/nanogit/retry"
)

type FakeRetrier struct {
	MaxAttemptsStub        func() int
	maxAttemptsMutex       sync.RWMutex
	maxAttemptsArgsForCall []struct {
	}
	maxAttemptsReturns struct {
		result1 int
	}
	maxAttemptsReturnsOnCall map[int]struct {
		result1 int
	}
	ShouldRetryStub        func(context.Context, error, int) bool
	shouldRetryMutex       sync.RWMutex
	shouldRetryArgsForCall []struct {
		arg1 context.Context
		arg2 error
		arg3 int
	}
	shouldRetryReturns struct {
		result1 bool
	}
	shouldRetryReturnsOnCall map[int]struct {
		result1 bool
	}
	WaitStub        func(context.Context, int) error
	waitMutex       sync.RWMutex
	waitArgsForCall []struct {
		arg1 context.Context
		arg2 int
	}
	waitReturns struct {
		result1 error
	}
	waitReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRetrier) MaxAttempts() int {
	fake.maxAttemptsMutex.Lock()
	ret, specificReturn := fake.maxAttemptsReturnsOnCall[len(fake.maxAttemptsArgsForCall)]
	fake.maxAttemptsArgsForCall = append(fake.maxAttemptsArgsForCall, struct {
	}{})
	stub := fake.MaxAttemptsStub
	fakeReturns := fake.maxAttemptsReturns
	fake.recordInvocation("MaxAttempts", []interface{}{})
	fake.maxAttemptsMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeRetrier) MaxAttemptsCallCount() int {
	fake.maxAttemptsMutex.RLock()
	defer fake.maxAttemptsMutex.RUnlock()
	return len(fake.maxAttemptsArgsForCall)
}

func (fake *FakeRetrier) MaxAttemptsCalls(stub func() int) {
	fake.maxAttemptsMutex.Lock()
	defer fake.maxAttemptsMutex.Unlock()
	fake.MaxAttemptsStub = stub
}

func (fake *FakeRetrier) MaxAttemptsReturns(result1 int) {
	fake.maxAttemptsMutex.Lock()
	defer fake.maxAttemptsMutex.Unlock()
	fake.MaxAttemptsStub = nil
	fake.maxAttemptsReturns = struct {
		result1 int
	}{result1}
}

func (fake *FakeRetrier) MaxAttemptsReturnsOnCall(i int, result1 int) {
	fake.maxAttemptsMutex.Lock()
	defer fake.maxAttemptsMutex.Unlock()
	fake.MaxAttemptsStub = nil
	if fake.maxAttemptsReturnsOnCall == nil {
		fake.maxAttemptsReturnsOnCall = make(map[int]struct {
			result1 int
		})
	}
	fake.maxAttemptsReturnsOnCall[i] = struct {
		result1 int
	}{result1}
}

func (fake *FakeRetrier) ShouldRetry(arg1 context.Context, arg2 error, arg3 int) bool {
	fake.shouldRetryMutex.Lock()
	ret, specificReturn := fake.shouldRetryReturnsOnCall[len(fake.shouldRetryArgsForCall)]
	fake.shouldRetryArgsForCall = append(fake.shouldRetryArgsForCall, struct {
		arg1 context.Context
		arg2 error
		arg3 int
	}{arg1, arg2, arg3})
	stub := fake.ShouldRetryStub
	fakeReturns := fake.shouldRetryReturns
	fake.recordInvocation("ShouldRetry", []interface{}{arg1, arg2, arg3})
	fake.shouldRetryMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeRetrier) ShouldRetryCallCount() int {
	fake.shouldRetryMutex.RLock()
	defer fake.shouldRetryMutex.RUnlock()
	return len(fake.shouldRetryArgsForCall)
}

func (fake *FakeRetrier) ShouldRetryCalls(stub func(context.Context, error, int) bool) {
	fake.shouldRetryMutex.Lock()
	defer fake.shouldRetryMutex.Unlock()
	fake.ShouldRetryStub = stub
}

func (fake *FakeRetrier) ShouldRetryArgsForCall(i int) (context.Context, error, int) {
	fake.shouldRetryMutex.RLock()
	defer fake.shouldRetryMutex.RUnlock()
	argsForCall := fake.shouldRetryArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeRetrier) ShouldRetryReturns(result1 bool) {
	fake.shouldRetryMutex.Lock()
	defer fake.shouldRetryMutex.Unlock()
	fake.ShouldRetryStub = nil
	fake.shouldRetryReturns = struct {
		result1 bool
	}{result1}
}

func (fake *FakeRetrier) ShouldRetryReturnsOnCall(i int, result1 bool) {
	fake.shouldRetryMutex.Lock()
	defer fake.shouldRetryMutex.Unlock()
	fake.ShouldRetryStub = nil
	if fake.shouldRetryReturnsOnCall == nil {
		fake.shouldRetryReturnsOnCall = make(map[int]struct {
			result1 bool
		})
	}
	fake.shouldRetryReturnsOnCall[i] = struct {
		result1 bool
	}{result1}
}

func (fake *FakeRetrier) Wait(arg1 context.Context, arg2 int) error {
	fake.waitMutex.Lock()
	ret, specificReturn := fake.waitReturnsOnCall[len(fake.waitArgsForCall)]
	fake.waitArgsForCall = append(fake.waitArgsForCall, struct {
		arg1 context.Context
		arg2 int
	}{arg1, arg2})
	stub := fake.WaitStub
	fakeReturns := fake.waitReturns
	fake.recordInvocation("Wait", []interface{}{arg1, arg2})
	fake.waitMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeRetrier) WaitCallCount() int {
	fake.waitMutex.RLock()
	defer fake.waitMutex.RUnlock()
	return len(fake.waitArgsForCall)
}

func (fake *FakeRetrier) WaitCalls(stub func(context.Context, int) error) {
	fake.waitMutex.Lock()
	defer fake.waitMutex.Unlock()
	fake.WaitStub = stub
}

func (fake *FakeRetrier) WaitArgsForCall(i int) (context.Context, int) {
	fake.waitMutex.RLock()
	defer fake.waitMutex.RUnlock()
	argsForCall := fake.waitArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeRetrier) WaitReturns(result1 error) {
	fake.waitMutex.Lock()
	defer fake.waitMutex.Unlock()
	fake.WaitStub = nil
	fake.waitReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeRetrier) WaitReturnsOnCall(i int, result1 error) {
	fake.waitMutex.Lock()
	defer fake.waitMutex.Unlock()
	fake.WaitStub = nil
	if fake.waitReturnsOnCall == nil {
		fake.waitReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.waitReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeRetrier) 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 _ retry.Retrier = new(FakeRetrier)
