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

import (
	"io"
	"sync"

	"github.com/cloudfoundry/bosh-agent/agent/blobstore"
	"github.com/cloudfoundry/bosh-utils/crypto"
	"github.com/cloudfoundry/bosh-utils/system"
)

type FakeBlobManagerInterface struct {
	BlobExistsStub        func(string) bool
	blobExistsMutex       sync.RWMutex
	blobExistsArgsForCall []struct {
		arg1 string
	}
	blobExistsReturns struct {
		result1 bool
	}
	blobExistsReturnsOnCall map[int]struct {
		result1 bool
	}
	DeleteStub        func(string) error
	deleteMutex       sync.RWMutex
	deleteArgsForCall []struct {
		arg1 string
	}
	deleteReturns struct {
		result1 error
	}
	deleteReturnsOnCall map[int]struct {
		result1 error
	}
	FetchStub        func(string) (system.File, int, error)
	fetchMutex       sync.RWMutex
	fetchArgsForCall []struct {
		arg1 string
	}
	fetchReturns struct {
		result1 system.File
		result2 int
		result3 error
	}
	fetchReturnsOnCall map[int]struct {
		result1 system.File
		result2 int
		result3 error
	}
	GetPathStub        func(string, crypto.Digest) (string, error)
	getPathMutex       sync.RWMutex
	getPathArgsForCall []struct {
		arg1 string
		arg2 crypto.Digest
	}
	getPathReturns struct {
		result1 string
		result2 error
	}
	getPathReturnsOnCall map[int]struct {
		result1 string
		result2 error
	}
	WriteStub        func(string, io.Reader) error
	writeMutex       sync.RWMutex
	writeArgsForCall []struct {
		arg1 string
		arg2 io.Reader
	}
	writeReturns struct {
		result1 error
	}
	writeReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeBlobManagerInterface) BlobExists(arg1 string) bool {
	fake.blobExistsMutex.Lock()
	ret, specificReturn := fake.blobExistsReturnsOnCall[len(fake.blobExistsArgsForCall)]
	fake.blobExistsArgsForCall = append(fake.blobExistsArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("BlobExists", []interface{}{arg1})
	fake.blobExistsMutex.Unlock()
	if fake.BlobExistsStub != nil {
		return fake.BlobExistsStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.blobExistsReturns
	return fakeReturns.result1
}

func (fake *FakeBlobManagerInterface) BlobExistsCallCount() int {
	fake.blobExistsMutex.RLock()
	defer fake.blobExistsMutex.RUnlock()
	return len(fake.blobExistsArgsForCall)
}

func (fake *FakeBlobManagerInterface) BlobExistsCalls(stub func(string) bool) {
	fake.blobExistsMutex.Lock()
	defer fake.blobExistsMutex.Unlock()
	fake.BlobExistsStub = stub
}

func (fake *FakeBlobManagerInterface) BlobExistsArgsForCall(i int) string {
	fake.blobExistsMutex.RLock()
	defer fake.blobExistsMutex.RUnlock()
	argsForCall := fake.blobExistsArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeBlobManagerInterface) BlobExistsReturns(result1 bool) {
	fake.blobExistsMutex.Lock()
	defer fake.blobExistsMutex.Unlock()
	fake.BlobExistsStub = nil
	fake.blobExistsReturns = struct {
		result1 bool
	}{result1}
}

func (fake *FakeBlobManagerInterface) BlobExistsReturnsOnCall(i int, result1 bool) {
	fake.blobExistsMutex.Lock()
	defer fake.blobExistsMutex.Unlock()
	fake.BlobExistsStub = nil
	if fake.blobExistsReturnsOnCall == nil {
		fake.blobExistsReturnsOnCall = make(map[int]struct {
			result1 bool
		})
	}
	fake.blobExistsReturnsOnCall[i] = struct {
		result1 bool
	}{result1}
}

func (fake *FakeBlobManagerInterface) Delete(arg1 string) error {
	fake.deleteMutex.Lock()
	ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)]
	fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("Delete", []interface{}{arg1})
	fake.deleteMutex.Unlock()
	if fake.DeleteStub != nil {
		return fake.DeleteStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.deleteReturns
	return fakeReturns.result1
}

func (fake *FakeBlobManagerInterface) DeleteCallCount() int {
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	return len(fake.deleteArgsForCall)
}

func (fake *FakeBlobManagerInterface) DeleteCalls(stub func(string) error) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = stub
}

func (fake *FakeBlobManagerInterface) DeleteArgsForCall(i int) string {
	fake.deleteMutex.RLock()
	defer fake.deleteMutex.RUnlock()
	argsForCall := fake.deleteArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeBlobManagerInterface) DeleteReturns(result1 error) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = nil
	fake.deleteReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeBlobManagerInterface) DeleteReturnsOnCall(i int, result1 error) {
	fake.deleteMutex.Lock()
	defer fake.deleteMutex.Unlock()
	fake.DeleteStub = nil
	if fake.deleteReturnsOnCall == nil {
		fake.deleteReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.deleteReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeBlobManagerInterface) Fetch(arg1 string) (system.File, int, error) {
	fake.fetchMutex.Lock()
	ret, specificReturn := fake.fetchReturnsOnCall[len(fake.fetchArgsForCall)]
	fake.fetchArgsForCall = append(fake.fetchArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("Fetch", []interface{}{arg1})
	fake.fetchMutex.Unlock()
	if fake.FetchStub != nil {
		return fake.FetchStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2, ret.result3
	}
	fakeReturns := fake.fetchReturns
	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
}

func (fake *FakeBlobManagerInterface) FetchCallCount() int {
	fake.fetchMutex.RLock()
	defer fake.fetchMutex.RUnlock()
	return len(fake.fetchArgsForCall)
}

func (fake *FakeBlobManagerInterface) FetchCalls(stub func(string) (system.File, int, error)) {
	fake.fetchMutex.Lock()
	defer fake.fetchMutex.Unlock()
	fake.FetchStub = stub
}

func (fake *FakeBlobManagerInterface) FetchArgsForCall(i int) string {
	fake.fetchMutex.RLock()
	defer fake.fetchMutex.RUnlock()
	argsForCall := fake.fetchArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeBlobManagerInterface) FetchReturns(result1 system.File, result2 int, result3 error) {
	fake.fetchMutex.Lock()
	defer fake.fetchMutex.Unlock()
	fake.FetchStub = nil
	fake.fetchReturns = struct {
		result1 system.File
		result2 int
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeBlobManagerInterface) FetchReturnsOnCall(i int, result1 system.File, result2 int, result3 error) {
	fake.fetchMutex.Lock()
	defer fake.fetchMutex.Unlock()
	fake.FetchStub = nil
	if fake.fetchReturnsOnCall == nil {
		fake.fetchReturnsOnCall = make(map[int]struct {
			result1 system.File
			result2 int
			result3 error
		})
	}
	fake.fetchReturnsOnCall[i] = struct {
		result1 system.File
		result2 int
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeBlobManagerInterface) GetPath(arg1 string, arg2 crypto.Digest) (string, error) {
	fake.getPathMutex.Lock()
	ret, specificReturn := fake.getPathReturnsOnCall[len(fake.getPathArgsForCall)]
	fake.getPathArgsForCall = append(fake.getPathArgsForCall, struct {
		arg1 string
		arg2 crypto.Digest
	}{arg1, arg2})
	fake.recordInvocation("GetPath", []interface{}{arg1, arg2})
	fake.getPathMutex.Unlock()
	if fake.GetPathStub != nil {
		return fake.GetPathStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getPathReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeBlobManagerInterface) GetPathCallCount() int {
	fake.getPathMutex.RLock()
	defer fake.getPathMutex.RUnlock()
	return len(fake.getPathArgsForCall)
}

func (fake *FakeBlobManagerInterface) GetPathCalls(stub func(string, crypto.Digest) (string, error)) {
	fake.getPathMutex.Lock()
	defer fake.getPathMutex.Unlock()
	fake.GetPathStub = stub
}

func (fake *FakeBlobManagerInterface) GetPathArgsForCall(i int) (string, crypto.Digest) {
	fake.getPathMutex.RLock()
	defer fake.getPathMutex.RUnlock()
	argsForCall := fake.getPathArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeBlobManagerInterface) GetPathReturns(result1 string, result2 error) {
	fake.getPathMutex.Lock()
	defer fake.getPathMutex.Unlock()
	fake.GetPathStub = nil
	fake.getPathReturns = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeBlobManagerInterface) GetPathReturnsOnCall(i int, result1 string, result2 error) {
	fake.getPathMutex.Lock()
	defer fake.getPathMutex.Unlock()
	fake.GetPathStub = nil
	if fake.getPathReturnsOnCall == nil {
		fake.getPathReturnsOnCall = make(map[int]struct {
			result1 string
			result2 error
		})
	}
	fake.getPathReturnsOnCall[i] = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeBlobManagerInterface) Write(arg1 string, arg2 io.Reader) error {
	fake.writeMutex.Lock()
	ret, specificReturn := fake.writeReturnsOnCall[len(fake.writeArgsForCall)]
	fake.writeArgsForCall = append(fake.writeArgsForCall, struct {
		arg1 string
		arg2 io.Reader
	}{arg1, arg2})
	fake.recordInvocation("Write", []interface{}{arg1, arg2})
	fake.writeMutex.Unlock()
	if fake.WriteStub != nil {
		return fake.WriteStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.writeReturns
	return fakeReturns.result1
}

func (fake *FakeBlobManagerInterface) WriteCallCount() int {
	fake.writeMutex.RLock()
	defer fake.writeMutex.RUnlock()
	return len(fake.writeArgsForCall)
}

func (fake *FakeBlobManagerInterface) WriteCalls(stub func(string, io.Reader) error) {
	fake.writeMutex.Lock()
	defer fake.writeMutex.Unlock()
	fake.WriteStub = stub
}

func (fake *FakeBlobManagerInterface) WriteArgsForCall(i int) (string, io.Reader) {
	fake.writeMutex.RLock()
	defer fake.writeMutex.RUnlock()
	argsForCall := fake.writeArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeBlobManagerInterface) WriteReturns(result1 error) {
	fake.writeMutex.Lock()
	defer fake.writeMutex.Unlock()
	fake.WriteStub = nil
	fake.writeReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeBlobManagerInterface) WriteReturnsOnCall(i int, result1 error) {
	fake.writeMutex.Lock()
	defer fake.writeMutex.Unlock()
	fake.WriteStub = nil
	if fake.writeReturnsOnCall == nil {
		fake.writeReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.writeReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeBlobManagerInterface) 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 _ blobstore.BlobManagerInterface = new(FakeBlobManagerInterface)
