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

import (
	"sync"

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

type FakePortForwarder struct {
	ForwardStub        func(kawasaki.PortForwarderSpec) error
	forwardMutex       sync.RWMutex
	forwardArgsForCall []struct {
		arg1 kawasaki.PortForwarderSpec
	}
	forwardReturns struct {
		result1 error
	}
	forwardReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakePortForwarder) Forward(arg1 kawasaki.PortForwarderSpec) error {
	fake.forwardMutex.Lock()
	ret, specificReturn := fake.forwardReturnsOnCall[len(fake.forwardArgsForCall)]
	fake.forwardArgsForCall = append(fake.forwardArgsForCall, struct {
		arg1 kawasaki.PortForwarderSpec
	}{arg1})
	stub := fake.ForwardStub
	fakeReturns := fake.forwardReturns
	fake.recordInvocation("Forward", []interface{}{arg1})
	fake.forwardMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakePortForwarder) ForwardCallCount() int {
	fake.forwardMutex.RLock()
	defer fake.forwardMutex.RUnlock()
	return len(fake.forwardArgsForCall)
}

func (fake *FakePortForwarder) ForwardCalls(stub func(kawasaki.PortForwarderSpec) error) {
	fake.forwardMutex.Lock()
	defer fake.forwardMutex.Unlock()
	fake.ForwardStub = stub
}

func (fake *FakePortForwarder) ForwardArgsForCall(i int) kawasaki.PortForwarderSpec {
	fake.forwardMutex.RLock()
	defer fake.forwardMutex.RUnlock()
	argsForCall := fake.forwardArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakePortForwarder) ForwardReturns(result1 error) {
	fake.forwardMutex.Lock()
	defer fake.forwardMutex.Unlock()
	fake.ForwardStub = nil
	fake.forwardReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakePortForwarder) ForwardReturnsOnCall(i int, result1 error) {
	fake.forwardMutex.Lock()
	defer fake.forwardMutex.Unlock()
	fake.ForwardStub = nil
	if fake.forwardReturnsOnCall == nil {
		fake.forwardReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.forwardReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakePortForwarder) 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 _ kawasaki.PortForwarder = new(FakePortForwarder)
