// This file was generated by counterfeiter
package gatewayfakes

import (
	"sync"

	"code.cloudfoundry.org/lager"
	"github.com/apihub/apihub/gateway"
)

type FakeReverseProxyCreator struct {
	CreateStub        func(lager.Logger, gateway.ReverseProxySpec) (gateway.ReverseProxy, error)
	createMutex       sync.RWMutex
	createArgsForCall []struct {
		arg1 lager.Logger
		arg2 gateway.ReverseProxySpec
	}
	createReturns struct {
		result1 gateway.ReverseProxy
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeReverseProxyCreator) Create(arg1 lager.Logger, arg2 gateway.ReverseProxySpec) (gateway.ReverseProxy, error) {
	fake.createMutex.Lock()
	fake.createArgsForCall = append(fake.createArgsForCall, struct {
		arg1 lager.Logger
		arg2 gateway.ReverseProxySpec
	}{arg1, arg2})
	fake.recordInvocation("Create", []interface{}{arg1, arg2})
	fake.createMutex.Unlock()
	if fake.CreateStub != nil {
		return fake.CreateStub(arg1, arg2)
	} else {
		return fake.createReturns.result1, fake.createReturns.result2
	}
}

func (fake *FakeReverseProxyCreator) CreateCallCount() int {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	return len(fake.createArgsForCall)
}

func (fake *FakeReverseProxyCreator) CreateArgsForCall(i int) (lager.Logger, gateway.ReverseProxySpec) {
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	return fake.createArgsForCall[i].arg1, fake.createArgsForCall[i].arg2
}

func (fake *FakeReverseProxyCreator) CreateReturns(result1 gateway.ReverseProxy, result2 error) {
	fake.CreateStub = nil
	fake.createReturns = struct {
		result1 gateway.ReverseProxy
		result2 error
	}{result1, result2}
}

func (fake *FakeReverseProxyCreator) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.createMutex.RLock()
	defer fake.createMutex.RUnlock()
	return fake.invocations
}

func (fake *FakeReverseProxyCreator) 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 _ gateway.ReverseProxyCreator = new(FakeReverseProxyCreator)
