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

import (
	"net/http"
	"sync"

	"code.cloudfoundry.org/cli/cf/api/authentication"
	"code.cloudfoundry.org/cli/cf/configuration/coreconfig"
)

type FakeRepository struct {
	AuthenticateStub        func(map[string]string) error
	authenticateMutex       sync.RWMutex
	authenticateArgsForCall []struct {
		arg1 map[string]string
	}
	authenticateReturns struct {
		result1 error
	}
	authenticateReturnsOnCall map[int]struct {
		result1 error
	}
	AuthorizeStub        func(string) (string, error)
	authorizeMutex       sync.RWMutex
	authorizeArgsForCall []struct {
		arg1 string
	}
	authorizeReturns struct {
		result1 string
		result2 error
	}
	authorizeReturnsOnCall map[int]struct {
		result1 string
		result2 error
	}
	DumpRequestStub        func(*http.Request)
	dumpRequestMutex       sync.RWMutex
	dumpRequestArgsForCall []struct {
		arg1 *http.Request
	}
	DumpResponseStub        func(*http.Response)
	dumpResponseMutex       sync.RWMutex
	dumpResponseArgsForCall []struct {
		arg1 *http.Response
	}
	GetLoginPromptsAndSaveUAAServerURLStub        func() (map[string]coreconfig.AuthPrompt, error)
	getLoginPromptsAndSaveUAAServerURLMutex       sync.RWMutex
	getLoginPromptsAndSaveUAAServerURLArgsForCall []struct {
	}
	getLoginPromptsAndSaveUAAServerURLReturns struct {
		result1 map[string]coreconfig.AuthPrompt
		result2 error
	}
	getLoginPromptsAndSaveUAAServerURLReturnsOnCall map[int]struct {
		result1 map[string]coreconfig.AuthPrompt
		result2 error
	}
	RefreshAuthTokenStub        func() (string, error)
	refreshAuthTokenMutex       sync.RWMutex
	refreshAuthTokenArgsForCall []struct {
	}
	refreshAuthTokenReturns struct {
		result1 string
		result2 error
	}
	refreshAuthTokenReturnsOnCall map[int]struct {
		result1 string
		result2 error
	}
	RefreshTokenStub        func(string) (string, error)
	refreshTokenMutex       sync.RWMutex
	refreshTokenArgsForCall []struct {
		arg1 string
	}
	refreshTokenReturns struct {
		result1 string
		result2 error
	}
	refreshTokenReturnsOnCall map[int]struct {
		result1 string
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRepository) Authenticate(arg1 map[string]string) error {
	fake.authenticateMutex.Lock()
	ret, specificReturn := fake.authenticateReturnsOnCall[len(fake.authenticateArgsForCall)]
	fake.authenticateArgsForCall = append(fake.authenticateArgsForCall, struct {
		arg1 map[string]string
	}{arg1})
	fake.recordInvocation("Authenticate", []interface{}{arg1})
	fake.authenticateMutex.Unlock()
	if fake.AuthenticateStub != nil {
		return fake.AuthenticateStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.authenticateReturns
	return fakeReturns.result1
}

func (fake *FakeRepository) AuthenticateCallCount() int {
	fake.authenticateMutex.RLock()
	defer fake.authenticateMutex.RUnlock()
	return len(fake.authenticateArgsForCall)
}

func (fake *FakeRepository) AuthenticateCalls(stub func(map[string]string) error) {
	fake.authenticateMutex.Lock()
	defer fake.authenticateMutex.Unlock()
	fake.AuthenticateStub = stub
}

func (fake *FakeRepository) AuthenticateArgsForCall(i int) map[string]string {
	fake.authenticateMutex.RLock()
	defer fake.authenticateMutex.RUnlock()
	argsForCall := fake.authenticateArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRepository) AuthenticateReturns(result1 error) {
	fake.authenticateMutex.Lock()
	defer fake.authenticateMutex.Unlock()
	fake.AuthenticateStub = nil
	fake.authenticateReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeRepository) AuthenticateReturnsOnCall(i int, result1 error) {
	fake.authenticateMutex.Lock()
	defer fake.authenticateMutex.Unlock()
	fake.AuthenticateStub = nil
	if fake.authenticateReturnsOnCall == nil {
		fake.authenticateReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.authenticateReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeRepository) Authorize(arg1 string) (string, error) {
	fake.authorizeMutex.Lock()
	ret, specificReturn := fake.authorizeReturnsOnCall[len(fake.authorizeArgsForCall)]
	fake.authorizeArgsForCall = append(fake.authorizeArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("Authorize", []interface{}{arg1})
	fake.authorizeMutex.Unlock()
	if fake.AuthorizeStub != nil {
		return fake.AuthorizeStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.authorizeReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRepository) AuthorizeCallCount() int {
	fake.authorizeMutex.RLock()
	defer fake.authorizeMutex.RUnlock()
	return len(fake.authorizeArgsForCall)
}

func (fake *FakeRepository) AuthorizeCalls(stub func(string) (string, error)) {
	fake.authorizeMutex.Lock()
	defer fake.authorizeMutex.Unlock()
	fake.AuthorizeStub = stub
}

func (fake *FakeRepository) AuthorizeArgsForCall(i int) string {
	fake.authorizeMutex.RLock()
	defer fake.authorizeMutex.RUnlock()
	argsForCall := fake.authorizeArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRepository) AuthorizeReturns(result1 string, result2 error) {
	fake.authorizeMutex.Lock()
	defer fake.authorizeMutex.Unlock()
	fake.AuthorizeStub = nil
	fake.authorizeReturns = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeRepository) AuthorizeReturnsOnCall(i int, result1 string, result2 error) {
	fake.authorizeMutex.Lock()
	defer fake.authorizeMutex.Unlock()
	fake.AuthorizeStub = nil
	if fake.authorizeReturnsOnCall == nil {
		fake.authorizeReturnsOnCall = make(map[int]struct {
			result1 string
			result2 error
		})
	}
	fake.authorizeReturnsOnCall[i] = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeRepository) DumpRequest(arg1 *http.Request) {
	fake.dumpRequestMutex.Lock()
	fake.dumpRequestArgsForCall = append(fake.dumpRequestArgsForCall, struct {
		arg1 *http.Request
	}{arg1})
	fake.recordInvocation("DumpRequest", []interface{}{arg1})
	fake.dumpRequestMutex.Unlock()
	if fake.DumpRequestStub != nil {
		fake.DumpRequestStub(arg1)
	}
}

func (fake *FakeRepository) DumpRequestCallCount() int {
	fake.dumpRequestMutex.RLock()
	defer fake.dumpRequestMutex.RUnlock()
	return len(fake.dumpRequestArgsForCall)
}

func (fake *FakeRepository) DumpRequestCalls(stub func(*http.Request)) {
	fake.dumpRequestMutex.Lock()
	defer fake.dumpRequestMutex.Unlock()
	fake.DumpRequestStub = stub
}

func (fake *FakeRepository) DumpRequestArgsForCall(i int) *http.Request {
	fake.dumpRequestMutex.RLock()
	defer fake.dumpRequestMutex.RUnlock()
	argsForCall := fake.dumpRequestArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRepository) DumpResponse(arg1 *http.Response) {
	fake.dumpResponseMutex.Lock()
	fake.dumpResponseArgsForCall = append(fake.dumpResponseArgsForCall, struct {
		arg1 *http.Response
	}{arg1})
	fake.recordInvocation("DumpResponse", []interface{}{arg1})
	fake.dumpResponseMutex.Unlock()
	if fake.DumpResponseStub != nil {
		fake.DumpResponseStub(arg1)
	}
}

func (fake *FakeRepository) DumpResponseCallCount() int {
	fake.dumpResponseMutex.RLock()
	defer fake.dumpResponseMutex.RUnlock()
	return len(fake.dumpResponseArgsForCall)
}

func (fake *FakeRepository) DumpResponseCalls(stub func(*http.Response)) {
	fake.dumpResponseMutex.Lock()
	defer fake.dumpResponseMutex.Unlock()
	fake.DumpResponseStub = stub
}

func (fake *FakeRepository) DumpResponseArgsForCall(i int) *http.Response {
	fake.dumpResponseMutex.RLock()
	defer fake.dumpResponseMutex.RUnlock()
	argsForCall := fake.dumpResponseArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRepository) GetLoginPromptsAndSaveUAAServerURL() (map[string]coreconfig.AuthPrompt, error) {
	fake.getLoginPromptsAndSaveUAAServerURLMutex.Lock()
	ret, specificReturn := fake.getLoginPromptsAndSaveUAAServerURLReturnsOnCall[len(fake.getLoginPromptsAndSaveUAAServerURLArgsForCall)]
	fake.getLoginPromptsAndSaveUAAServerURLArgsForCall = append(fake.getLoginPromptsAndSaveUAAServerURLArgsForCall, struct {
	}{})
	fake.recordInvocation("GetLoginPromptsAndSaveUAAServerURL", []interface{}{})
	fake.getLoginPromptsAndSaveUAAServerURLMutex.Unlock()
	if fake.GetLoginPromptsAndSaveUAAServerURLStub != nil {
		return fake.GetLoginPromptsAndSaveUAAServerURLStub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getLoginPromptsAndSaveUAAServerURLReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRepository) GetLoginPromptsAndSaveUAAServerURLCallCount() int {
	fake.getLoginPromptsAndSaveUAAServerURLMutex.RLock()
	defer fake.getLoginPromptsAndSaveUAAServerURLMutex.RUnlock()
	return len(fake.getLoginPromptsAndSaveUAAServerURLArgsForCall)
}

func (fake *FakeRepository) GetLoginPromptsAndSaveUAAServerURLCalls(stub func() (map[string]coreconfig.AuthPrompt, error)) {
	fake.getLoginPromptsAndSaveUAAServerURLMutex.Lock()
	defer fake.getLoginPromptsAndSaveUAAServerURLMutex.Unlock()
	fake.GetLoginPromptsAndSaveUAAServerURLStub = stub
}

func (fake *FakeRepository) GetLoginPromptsAndSaveUAAServerURLReturns(result1 map[string]coreconfig.AuthPrompt, result2 error) {
	fake.getLoginPromptsAndSaveUAAServerURLMutex.Lock()
	defer fake.getLoginPromptsAndSaveUAAServerURLMutex.Unlock()
	fake.GetLoginPromptsAndSaveUAAServerURLStub = nil
	fake.getLoginPromptsAndSaveUAAServerURLReturns = struct {
		result1 map[string]coreconfig.AuthPrompt
		result2 error
	}{result1, result2}
}

func (fake *FakeRepository) GetLoginPromptsAndSaveUAAServerURLReturnsOnCall(i int, result1 map[string]coreconfig.AuthPrompt, result2 error) {
	fake.getLoginPromptsAndSaveUAAServerURLMutex.Lock()
	defer fake.getLoginPromptsAndSaveUAAServerURLMutex.Unlock()
	fake.GetLoginPromptsAndSaveUAAServerURLStub = nil
	if fake.getLoginPromptsAndSaveUAAServerURLReturnsOnCall == nil {
		fake.getLoginPromptsAndSaveUAAServerURLReturnsOnCall = make(map[int]struct {
			result1 map[string]coreconfig.AuthPrompt
			result2 error
		})
	}
	fake.getLoginPromptsAndSaveUAAServerURLReturnsOnCall[i] = struct {
		result1 map[string]coreconfig.AuthPrompt
		result2 error
	}{result1, result2}
}

func (fake *FakeRepository) RefreshAuthToken() (string, error) {
	fake.refreshAuthTokenMutex.Lock()
	ret, specificReturn := fake.refreshAuthTokenReturnsOnCall[len(fake.refreshAuthTokenArgsForCall)]
	fake.refreshAuthTokenArgsForCall = append(fake.refreshAuthTokenArgsForCall, struct {
	}{})
	fake.recordInvocation("RefreshAuthToken", []interface{}{})
	fake.refreshAuthTokenMutex.Unlock()
	if fake.RefreshAuthTokenStub != nil {
		return fake.RefreshAuthTokenStub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.refreshAuthTokenReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRepository) RefreshAuthTokenCallCount() int {
	fake.refreshAuthTokenMutex.RLock()
	defer fake.refreshAuthTokenMutex.RUnlock()
	return len(fake.refreshAuthTokenArgsForCall)
}

func (fake *FakeRepository) RefreshAuthTokenCalls(stub func() (string, error)) {
	fake.refreshAuthTokenMutex.Lock()
	defer fake.refreshAuthTokenMutex.Unlock()
	fake.RefreshAuthTokenStub = stub
}

func (fake *FakeRepository) RefreshAuthTokenReturns(result1 string, result2 error) {
	fake.refreshAuthTokenMutex.Lock()
	defer fake.refreshAuthTokenMutex.Unlock()
	fake.RefreshAuthTokenStub = nil
	fake.refreshAuthTokenReturns = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeRepository) RefreshAuthTokenReturnsOnCall(i int, result1 string, result2 error) {
	fake.refreshAuthTokenMutex.Lock()
	defer fake.refreshAuthTokenMutex.Unlock()
	fake.RefreshAuthTokenStub = nil
	if fake.refreshAuthTokenReturnsOnCall == nil {
		fake.refreshAuthTokenReturnsOnCall = make(map[int]struct {
			result1 string
			result2 error
		})
	}
	fake.refreshAuthTokenReturnsOnCall[i] = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeRepository) RefreshToken(arg1 string) (string, error) {
	fake.refreshTokenMutex.Lock()
	ret, specificReturn := fake.refreshTokenReturnsOnCall[len(fake.refreshTokenArgsForCall)]
	fake.refreshTokenArgsForCall = append(fake.refreshTokenArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("RefreshToken", []interface{}{arg1})
	fake.refreshTokenMutex.Unlock()
	if fake.RefreshTokenStub != nil {
		return fake.RefreshTokenStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.refreshTokenReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRepository) RefreshTokenCallCount() int {
	fake.refreshTokenMutex.RLock()
	defer fake.refreshTokenMutex.RUnlock()
	return len(fake.refreshTokenArgsForCall)
}

func (fake *FakeRepository) RefreshTokenCalls(stub func(string) (string, error)) {
	fake.refreshTokenMutex.Lock()
	defer fake.refreshTokenMutex.Unlock()
	fake.RefreshTokenStub = stub
}

func (fake *FakeRepository) RefreshTokenArgsForCall(i int) string {
	fake.refreshTokenMutex.RLock()
	defer fake.refreshTokenMutex.RUnlock()
	argsForCall := fake.refreshTokenArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeRepository) RefreshTokenReturns(result1 string, result2 error) {
	fake.refreshTokenMutex.Lock()
	defer fake.refreshTokenMutex.Unlock()
	fake.RefreshTokenStub = nil
	fake.refreshTokenReturns = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeRepository) RefreshTokenReturnsOnCall(i int, result1 string, result2 error) {
	fake.refreshTokenMutex.Lock()
	defer fake.refreshTokenMutex.Unlock()
	fake.RefreshTokenStub = nil
	if fake.refreshTokenReturnsOnCall == nil {
		fake.refreshTokenReturnsOnCall = make(map[int]struct {
			result1 string
			result2 error
		})
	}
	fake.refreshTokenReturnsOnCall[i] = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeRepository) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.authenticateMutex.RLock()
	defer fake.authenticateMutex.RUnlock()
	fake.authorizeMutex.RLock()
	defer fake.authorizeMutex.RUnlock()
	fake.dumpRequestMutex.RLock()
	defer fake.dumpRequestMutex.RUnlock()
	fake.dumpResponseMutex.RLock()
	defer fake.dumpResponseMutex.RUnlock()
	fake.getLoginPromptsAndSaveUAAServerURLMutex.RLock()
	defer fake.getLoginPromptsAndSaveUAAServerURLMutex.RUnlock()
	fake.refreshAuthTokenMutex.RLock()
	defer fake.refreshAuthTokenMutex.RUnlock()
	fake.refreshTokenMutex.RLock()
	defer fake.refreshTokenMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeRepository) 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 _ authentication.Repository = new(FakeRepository)
