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

import (
	"sync"

	"code.cloudfoundry.org/eirini/api"
	"code.cloudfoundry.org/eirini/bifrost"
	"code.cloudfoundry.org/eirini/models/cf"
)

type FakeLRPConverter struct {
	ConvertLRPStub        func(cf.DesireLRPRequest) (api.LRP, error)
	convertLRPMutex       sync.RWMutex
	convertLRPArgsForCall []struct {
		arg1 cf.DesireLRPRequest
	}
	convertLRPReturns struct {
		result1 api.LRP
		result2 error
	}
	convertLRPReturnsOnCall map[int]struct {
		result1 api.LRP
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeLRPConverter) ConvertLRP(arg1 cf.DesireLRPRequest) (api.LRP, error) {
	fake.convertLRPMutex.Lock()
	ret, specificReturn := fake.convertLRPReturnsOnCall[len(fake.convertLRPArgsForCall)]
	fake.convertLRPArgsForCall = append(fake.convertLRPArgsForCall, struct {
		arg1 cf.DesireLRPRequest
	}{arg1})
	stub := fake.ConvertLRPStub
	fakeReturns := fake.convertLRPReturns
	fake.recordInvocation("ConvertLRP", []interface{}{arg1})
	fake.convertLRPMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeLRPConverter) ConvertLRPCallCount() int {
	fake.convertLRPMutex.RLock()
	defer fake.convertLRPMutex.RUnlock()
	return len(fake.convertLRPArgsForCall)
}

func (fake *FakeLRPConverter) ConvertLRPCalls(stub func(cf.DesireLRPRequest) (api.LRP, error)) {
	fake.convertLRPMutex.Lock()
	defer fake.convertLRPMutex.Unlock()
	fake.ConvertLRPStub = stub
}

func (fake *FakeLRPConverter) ConvertLRPArgsForCall(i int) cf.DesireLRPRequest {
	fake.convertLRPMutex.RLock()
	defer fake.convertLRPMutex.RUnlock()
	argsForCall := fake.convertLRPArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeLRPConverter) ConvertLRPReturns(result1 api.LRP, result2 error) {
	fake.convertLRPMutex.Lock()
	defer fake.convertLRPMutex.Unlock()
	fake.ConvertLRPStub = nil
	fake.convertLRPReturns = struct {
		result1 api.LRP
		result2 error
	}{result1, result2}
}

func (fake *FakeLRPConverter) ConvertLRPReturnsOnCall(i int, result1 api.LRP, result2 error) {
	fake.convertLRPMutex.Lock()
	defer fake.convertLRPMutex.Unlock()
	fake.ConvertLRPStub = nil
	if fake.convertLRPReturnsOnCall == nil {
		fake.convertLRPReturnsOnCall = make(map[int]struct {
			result1 api.LRP
			result2 error
		})
	}
	fake.convertLRPReturnsOnCall[i] = struct {
		result1 api.LRP
		result2 error
	}{result1, result2}
}

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

func (fake *FakeLRPConverter) 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 _ bifrost.LRPConverter = new(FakeLRPConverter)
