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

import (
	"sync"

	"code.cloudfoundry.org/diego-ssh/handlers"
	"code.cloudfoundry.org/lager/v3"
	"golang.org/x/crypto/ssh"
)

type FakeNewChannelHandler struct {
	HandleNewChannelStub        func(lager.Logger, ssh.NewChannel)
	handleNewChannelMutex       sync.RWMutex
	handleNewChannelArgsForCall []struct {
		arg1 lager.Logger
		arg2 ssh.NewChannel
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeNewChannelHandler) HandleNewChannel(arg1 lager.Logger, arg2 ssh.NewChannel) {
	fake.handleNewChannelMutex.Lock()
	fake.handleNewChannelArgsForCall = append(fake.handleNewChannelArgsForCall, struct {
		arg1 lager.Logger
		arg2 ssh.NewChannel
	}{arg1, arg2})
	fake.recordInvocation("HandleNewChannel", []interface{}{arg1, arg2})
	handleNewChannelStubCopy := fake.HandleNewChannelStub
	fake.handleNewChannelMutex.Unlock()
	if handleNewChannelStubCopy != nil {
		handleNewChannelStubCopy(arg1, arg2)
	}
}

func (fake *FakeNewChannelHandler) HandleNewChannelCallCount() int {
	fake.handleNewChannelMutex.RLock()
	defer fake.handleNewChannelMutex.RUnlock()
	return len(fake.handleNewChannelArgsForCall)
}

func (fake *FakeNewChannelHandler) HandleNewChannelCalls(stub func(lager.Logger, ssh.NewChannel)) {
	fake.handleNewChannelMutex.Lock()
	defer fake.handleNewChannelMutex.Unlock()
	fake.HandleNewChannelStub = stub
}

func (fake *FakeNewChannelHandler) HandleNewChannelArgsForCall(i int) (lager.Logger, ssh.NewChannel) {
	fake.handleNewChannelMutex.RLock()
	defer fake.handleNewChannelMutex.RUnlock()
	argsForCall := fake.handleNewChannelArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

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

func (fake *FakeNewChannelHandler) 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 _ handlers.NewChannelHandler = new(FakeNewChannelHandler)
