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

import (
	"net"
	"sync"

	"code.cloudfoundry.org/diego-ssh/server"
)

type FakeConnectionHandler struct {
	HandleConnectionStub        func(net.Conn)
	handleConnectionMutex       sync.RWMutex
	handleConnectionArgsForCall []struct {
		arg1 net.Conn
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeConnectionHandler) HandleConnection(arg1 net.Conn) {
	fake.handleConnectionMutex.Lock()
	fake.handleConnectionArgsForCall = append(fake.handleConnectionArgsForCall, struct {
		arg1 net.Conn
	}{arg1})
	fake.recordInvocation("HandleConnection", []interface{}{arg1})
	handleConnectionStubCopy := fake.HandleConnectionStub
	fake.handleConnectionMutex.Unlock()
	if handleConnectionStubCopy != nil {
		handleConnectionStubCopy(arg1)
	}
}

func (fake *FakeConnectionHandler) HandleConnectionCallCount() int {
	fake.handleConnectionMutex.RLock()
	defer fake.handleConnectionMutex.RUnlock()
	return len(fake.handleConnectionArgsForCall)
}

func (fake *FakeConnectionHandler) HandleConnectionCalls(stub func(net.Conn)) {
	fake.handleConnectionMutex.Lock()
	defer fake.handleConnectionMutex.Unlock()
	fake.HandleConnectionStub = stub
}

func (fake *FakeConnectionHandler) HandleConnectionArgsForCall(i int) net.Conn {
	fake.handleConnectionMutex.RLock()
	defer fake.handleConnectionMutex.RUnlock()
	argsForCall := fake.handleConnectionArgsForCall[i]
	return argsForCall.arg1
}

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

func (fake *FakeConnectionHandler) 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 _ server.ConnectionHandler = new(FakeConnectionHandler)
