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

import (
	"net/url"
	"sync"

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

type FakeImageSpecCreator struct {
	CreateImageSpecStub        func(*url.URL, string) (*url.URL, error)
	createImageSpecMutex       sync.RWMutex
	createImageSpecArgsForCall []struct {
		arg1 *url.URL
		arg2 string
	}
	createImageSpecReturns struct {
		result1 *url.URL
		result2 error
	}
	createImageSpecReturnsOnCall map[int]struct {
		result1 *url.URL
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeImageSpecCreator) CreateImageSpec(arg1 *url.URL, arg2 string) (*url.URL, error) {
	fake.createImageSpecMutex.Lock()
	ret, specificReturn := fake.createImageSpecReturnsOnCall[len(fake.createImageSpecArgsForCall)]
	fake.createImageSpecArgsForCall = append(fake.createImageSpecArgsForCall, struct {
		arg1 *url.URL
		arg2 string
	}{arg1, arg2})
	stub := fake.CreateImageSpecStub
	fakeReturns := fake.createImageSpecReturns
	fake.recordInvocation("CreateImageSpec", []interface{}{arg1, arg2})
	fake.createImageSpecMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeImageSpecCreator) CreateImageSpecCallCount() int {
	fake.createImageSpecMutex.RLock()
	defer fake.createImageSpecMutex.RUnlock()
	return len(fake.createImageSpecArgsForCall)
}

func (fake *FakeImageSpecCreator) CreateImageSpecCalls(stub func(*url.URL, string) (*url.URL, error)) {
	fake.createImageSpecMutex.Lock()
	defer fake.createImageSpecMutex.Unlock()
	fake.CreateImageSpecStub = stub
}

func (fake *FakeImageSpecCreator) CreateImageSpecArgsForCall(i int) (*url.URL, string) {
	fake.createImageSpecMutex.RLock()
	defer fake.createImageSpecMutex.RUnlock()
	argsForCall := fake.createImageSpecArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeImageSpecCreator) CreateImageSpecReturns(result1 *url.URL, result2 error) {
	fake.createImageSpecMutex.Lock()
	defer fake.createImageSpecMutex.Unlock()
	fake.CreateImageSpecStub = nil
	fake.createImageSpecReturns = struct {
		result1 *url.URL
		result2 error
	}{result1, result2}
}

func (fake *FakeImageSpecCreator) CreateImageSpecReturnsOnCall(i int, result1 *url.URL, result2 error) {
	fake.createImageSpecMutex.Lock()
	defer fake.createImageSpecMutex.Unlock()
	fake.CreateImageSpecStub = nil
	if fake.createImageSpecReturnsOnCall == nil {
		fake.createImageSpecReturnsOnCall = make(map[int]struct {
			result1 *url.URL
			result2 error
		})
	}
	fake.createImageSpecReturnsOnCall[i] = struct {
		result1 *url.URL
		result2 error
	}{result1, result2}
}

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

func (fake *FakeImageSpecCreator) 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 _ imageplugin.ImageSpecCreator = new(FakeImageSpecCreator)
