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

import (
	"database/sql"
	"sync"

	"code.cloudfoundry.org/app-autoscaler/src/autoscaler/db"
	"code.cloudfoundry.org/app-autoscaler/src/autoscaler/models"
)

type FakeScalingEngineDB struct {
	CanScaleAppStub        func(string) (bool, int64, error)
	canScaleAppMutex       sync.RWMutex
	canScaleAppArgsForCall []struct {
		arg1 string
	}
	canScaleAppReturns struct {
		result1 bool
		result2 int64
		result3 error
	}
	canScaleAppReturnsOnCall map[int]struct {
		result1 bool
		result2 int64
		result3 error
	}
	CloseStub        func() error
	closeMutex       sync.RWMutex
	closeArgsForCall []struct {
	}
	closeReturns struct {
		result1 error
	}
	closeReturnsOnCall map[int]struct {
		result1 error
	}
	GetActiveScheduleStub        func(string) (*models.ActiveSchedule, error)
	getActiveScheduleMutex       sync.RWMutex
	getActiveScheduleArgsForCall []struct {
		arg1 string
	}
	getActiveScheduleReturns struct {
		result1 *models.ActiveSchedule
		result2 error
	}
	getActiveScheduleReturnsOnCall map[int]struct {
		result1 *models.ActiveSchedule
		result2 error
	}
	GetActiveSchedulesStub        func() (map[string]string, error)
	getActiveSchedulesMutex       sync.RWMutex
	getActiveSchedulesArgsForCall []struct {
	}
	getActiveSchedulesReturns struct {
		result1 map[string]string
		result2 error
	}
	getActiveSchedulesReturnsOnCall map[int]struct {
		result1 map[string]string
		result2 error
	}
	GetDBStatusStub        func() sql.DBStats
	getDBStatusMutex       sync.RWMutex
	getDBStatusArgsForCall []struct {
	}
	getDBStatusReturns struct {
		result1 sql.DBStats
	}
	getDBStatusReturnsOnCall map[int]struct {
		result1 sql.DBStats
	}
	PruneScalingHistoriesStub        func(int64) error
	pruneScalingHistoriesMutex       sync.RWMutex
	pruneScalingHistoriesArgsForCall []struct {
		arg1 int64
	}
	pruneScalingHistoriesReturns struct {
		result1 error
	}
	pruneScalingHistoriesReturnsOnCall map[int]struct {
		result1 error
	}
	RemoveActiveScheduleStub        func(string) error
	removeActiveScheduleMutex       sync.RWMutex
	removeActiveScheduleArgsForCall []struct {
		arg1 string
	}
	removeActiveScheduleReturns struct {
		result1 error
	}
	removeActiveScheduleReturnsOnCall map[int]struct {
		result1 error
	}
	RetrieveScalingHistoriesStub        func(string, int64, int64, db.OrderType, bool) ([]*models.AppScalingHistory, error)
	retrieveScalingHistoriesMutex       sync.RWMutex
	retrieveScalingHistoriesArgsForCall []struct {
		arg1 string
		arg2 int64
		arg3 int64
		arg4 db.OrderType
		arg5 bool
	}
	retrieveScalingHistoriesReturns struct {
		result1 []*models.AppScalingHistory
		result2 error
	}
	retrieveScalingHistoriesReturnsOnCall map[int]struct {
		result1 []*models.AppScalingHistory
		result2 error
	}
	SaveScalingHistoryStub        func(*models.AppScalingHistory) error
	saveScalingHistoryMutex       sync.RWMutex
	saveScalingHistoryArgsForCall []struct {
		arg1 *models.AppScalingHistory
	}
	saveScalingHistoryReturns struct {
		result1 error
	}
	saveScalingHistoryReturnsOnCall map[int]struct {
		result1 error
	}
	SetActiveScheduleStub        func(string, *models.ActiveSchedule) error
	setActiveScheduleMutex       sync.RWMutex
	setActiveScheduleArgsForCall []struct {
		arg1 string
		arg2 *models.ActiveSchedule
	}
	setActiveScheduleReturns struct {
		result1 error
	}
	setActiveScheduleReturnsOnCall map[int]struct {
		result1 error
	}
	UpdateScalingCooldownExpireTimeStub        func(string, int64) error
	updateScalingCooldownExpireTimeMutex       sync.RWMutex
	updateScalingCooldownExpireTimeArgsForCall []struct {
		arg1 string
		arg2 int64
	}
	updateScalingCooldownExpireTimeReturns struct {
		result1 error
	}
	updateScalingCooldownExpireTimeReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeScalingEngineDB) CanScaleApp(arg1 string) (bool, int64, error) {
	fake.canScaleAppMutex.Lock()
	ret, specificReturn := fake.canScaleAppReturnsOnCall[len(fake.canScaleAppArgsForCall)]
	fake.canScaleAppArgsForCall = append(fake.canScaleAppArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.CanScaleAppStub
	fakeReturns := fake.canScaleAppReturns
	fake.recordInvocation("CanScaleApp", []interface{}{arg1})
	fake.canScaleAppMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2, ret.result3
	}
	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
}

func (fake *FakeScalingEngineDB) CanScaleAppCallCount() int {
	fake.canScaleAppMutex.RLock()
	defer fake.canScaleAppMutex.RUnlock()
	return len(fake.canScaleAppArgsForCall)
}

func (fake *FakeScalingEngineDB) CanScaleAppCalls(stub func(string) (bool, int64, error)) {
	fake.canScaleAppMutex.Lock()
	defer fake.canScaleAppMutex.Unlock()
	fake.CanScaleAppStub = stub
}

func (fake *FakeScalingEngineDB) CanScaleAppArgsForCall(i int) string {
	fake.canScaleAppMutex.RLock()
	defer fake.canScaleAppMutex.RUnlock()
	argsForCall := fake.canScaleAppArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeScalingEngineDB) CanScaleAppReturns(result1 bool, result2 int64, result3 error) {
	fake.canScaleAppMutex.Lock()
	defer fake.canScaleAppMutex.Unlock()
	fake.CanScaleAppStub = nil
	fake.canScaleAppReturns = struct {
		result1 bool
		result2 int64
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeScalingEngineDB) CanScaleAppReturnsOnCall(i int, result1 bool, result2 int64, result3 error) {
	fake.canScaleAppMutex.Lock()
	defer fake.canScaleAppMutex.Unlock()
	fake.CanScaleAppStub = nil
	if fake.canScaleAppReturnsOnCall == nil {
		fake.canScaleAppReturnsOnCall = make(map[int]struct {
			result1 bool
			result2 int64
			result3 error
		})
	}
	fake.canScaleAppReturnsOnCall[i] = struct {
		result1 bool
		result2 int64
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeScalingEngineDB) Close() error {
	fake.closeMutex.Lock()
	ret, specificReturn := fake.closeReturnsOnCall[len(fake.closeArgsForCall)]
	fake.closeArgsForCall = append(fake.closeArgsForCall, struct {
	}{})
	stub := fake.CloseStub
	fakeReturns := fake.closeReturns
	fake.recordInvocation("Close", []interface{}{})
	fake.closeMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeScalingEngineDB) CloseCallCount() int {
	fake.closeMutex.RLock()
	defer fake.closeMutex.RUnlock()
	return len(fake.closeArgsForCall)
}

func (fake *FakeScalingEngineDB) CloseCalls(stub func() error) {
	fake.closeMutex.Lock()
	defer fake.closeMutex.Unlock()
	fake.CloseStub = stub
}

func (fake *FakeScalingEngineDB) CloseReturns(result1 error) {
	fake.closeMutex.Lock()
	defer fake.closeMutex.Unlock()
	fake.CloseStub = nil
	fake.closeReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) CloseReturnsOnCall(i int, result1 error) {
	fake.closeMutex.Lock()
	defer fake.closeMutex.Unlock()
	fake.CloseStub = nil
	if fake.closeReturnsOnCall == nil {
		fake.closeReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.closeReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) GetActiveSchedule(arg1 string) (*models.ActiveSchedule, error) {
	fake.getActiveScheduleMutex.Lock()
	ret, specificReturn := fake.getActiveScheduleReturnsOnCall[len(fake.getActiveScheduleArgsForCall)]
	fake.getActiveScheduleArgsForCall = append(fake.getActiveScheduleArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.GetActiveScheduleStub
	fakeReturns := fake.getActiveScheduleReturns
	fake.recordInvocation("GetActiveSchedule", []interface{}{arg1})
	fake.getActiveScheduleMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeScalingEngineDB) GetActiveScheduleCallCount() int {
	fake.getActiveScheduleMutex.RLock()
	defer fake.getActiveScheduleMutex.RUnlock()
	return len(fake.getActiveScheduleArgsForCall)
}

func (fake *FakeScalingEngineDB) GetActiveScheduleCalls(stub func(string) (*models.ActiveSchedule, error)) {
	fake.getActiveScheduleMutex.Lock()
	defer fake.getActiveScheduleMutex.Unlock()
	fake.GetActiveScheduleStub = stub
}

func (fake *FakeScalingEngineDB) GetActiveScheduleArgsForCall(i int) string {
	fake.getActiveScheduleMutex.RLock()
	defer fake.getActiveScheduleMutex.RUnlock()
	argsForCall := fake.getActiveScheduleArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeScalingEngineDB) GetActiveScheduleReturns(result1 *models.ActiveSchedule, result2 error) {
	fake.getActiveScheduleMutex.Lock()
	defer fake.getActiveScheduleMutex.Unlock()
	fake.GetActiveScheduleStub = nil
	fake.getActiveScheduleReturns = struct {
		result1 *models.ActiveSchedule
		result2 error
	}{result1, result2}
}

func (fake *FakeScalingEngineDB) GetActiveScheduleReturnsOnCall(i int, result1 *models.ActiveSchedule, result2 error) {
	fake.getActiveScheduleMutex.Lock()
	defer fake.getActiveScheduleMutex.Unlock()
	fake.GetActiveScheduleStub = nil
	if fake.getActiveScheduleReturnsOnCall == nil {
		fake.getActiveScheduleReturnsOnCall = make(map[int]struct {
			result1 *models.ActiveSchedule
			result2 error
		})
	}
	fake.getActiveScheduleReturnsOnCall[i] = struct {
		result1 *models.ActiveSchedule
		result2 error
	}{result1, result2}
}

func (fake *FakeScalingEngineDB) GetActiveSchedules() (map[string]string, error) {
	fake.getActiveSchedulesMutex.Lock()
	ret, specificReturn := fake.getActiveSchedulesReturnsOnCall[len(fake.getActiveSchedulesArgsForCall)]
	fake.getActiveSchedulesArgsForCall = append(fake.getActiveSchedulesArgsForCall, struct {
	}{})
	stub := fake.GetActiveSchedulesStub
	fakeReturns := fake.getActiveSchedulesReturns
	fake.recordInvocation("GetActiveSchedules", []interface{}{})
	fake.getActiveSchedulesMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeScalingEngineDB) GetActiveSchedulesCallCount() int {
	fake.getActiveSchedulesMutex.RLock()
	defer fake.getActiveSchedulesMutex.RUnlock()
	return len(fake.getActiveSchedulesArgsForCall)
}

func (fake *FakeScalingEngineDB) GetActiveSchedulesCalls(stub func() (map[string]string, error)) {
	fake.getActiveSchedulesMutex.Lock()
	defer fake.getActiveSchedulesMutex.Unlock()
	fake.GetActiveSchedulesStub = stub
}

func (fake *FakeScalingEngineDB) GetActiveSchedulesReturns(result1 map[string]string, result2 error) {
	fake.getActiveSchedulesMutex.Lock()
	defer fake.getActiveSchedulesMutex.Unlock()
	fake.GetActiveSchedulesStub = nil
	fake.getActiveSchedulesReturns = struct {
		result1 map[string]string
		result2 error
	}{result1, result2}
}

func (fake *FakeScalingEngineDB) GetActiveSchedulesReturnsOnCall(i int, result1 map[string]string, result2 error) {
	fake.getActiveSchedulesMutex.Lock()
	defer fake.getActiveSchedulesMutex.Unlock()
	fake.GetActiveSchedulesStub = nil
	if fake.getActiveSchedulesReturnsOnCall == nil {
		fake.getActiveSchedulesReturnsOnCall = make(map[int]struct {
			result1 map[string]string
			result2 error
		})
	}
	fake.getActiveSchedulesReturnsOnCall[i] = struct {
		result1 map[string]string
		result2 error
	}{result1, result2}
}

func (fake *FakeScalingEngineDB) GetDBStatus() sql.DBStats {
	fake.getDBStatusMutex.Lock()
	ret, specificReturn := fake.getDBStatusReturnsOnCall[len(fake.getDBStatusArgsForCall)]
	fake.getDBStatusArgsForCall = append(fake.getDBStatusArgsForCall, struct {
	}{})
	stub := fake.GetDBStatusStub
	fakeReturns := fake.getDBStatusReturns
	fake.recordInvocation("GetDBStatus", []interface{}{})
	fake.getDBStatusMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeScalingEngineDB) GetDBStatusCallCount() int {
	fake.getDBStatusMutex.RLock()
	defer fake.getDBStatusMutex.RUnlock()
	return len(fake.getDBStatusArgsForCall)
}

func (fake *FakeScalingEngineDB) GetDBStatusCalls(stub func() sql.DBStats) {
	fake.getDBStatusMutex.Lock()
	defer fake.getDBStatusMutex.Unlock()
	fake.GetDBStatusStub = stub
}

func (fake *FakeScalingEngineDB) GetDBStatusReturns(result1 sql.DBStats) {
	fake.getDBStatusMutex.Lock()
	defer fake.getDBStatusMutex.Unlock()
	fake.GetDBStatusStub = nil
	fake.getDBStatusReturns = struct {
		result1 sql.DBStats
	}{result1}
}

func (fake *FakeScalingEngineDB) GetDBStatusReturnsOnCall(i int, result1 sql.DBStats) {
	fake.getDBStatusMutex.Lock()
	defer fake.getDBStatusMutex.Unlock()
	fake.GetDBStatusStub = nil
	if fake.getDBStatusReturnsOnCall == nil {
		fake.getDBStatusReturnsOnCall = make(map[int]struct {
			result1 sql.DBStats
		})
	}
	fake.getDBStatusReturnsOnCall[i] = struct {
		result1 sql.DBStats
	}{result1}
}

func (fake *FakeScalingEngineDB) PruneScalingHistories(arg1 int64) error {
	fake.pruneScalingHistoriesMutex.Lock()
	ret, specificReturn := fake.pruneScalingHistoriesReturnsOnCall[len(fake.pruneScalingHistoriesArgsForCall)]
	fake.pruneScalingHistoriesArgsForCall = append(fake.pruneScalingHistoriesArgsForCall, struct {
		arg1 int64
	}{arg1})
	stub := fake.PruneScalingHistoriesStub
	fakeReturns := fake.pruneScalingHistoriesReturns
	fake.recordInvocation("PruneScalingHistories", []interface{}{arg1})
	fake.pruneScalingHistoriesMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeScalingEngineDB) PruneScalingHistoriesCallCount() int {
	fake.pruneScalingHistoriesMutex.RLock()
	defer fake.pruneScalingHistoriesMutex.RUnlock()
	return len(fake.pruneScalingHistoriesArgsForCall)
}

func (fake *FakeScalingEngineDB) PruneScalingHistoriesCalls(stub func(int64) error) {
	fake.pruneScalingHistoriesMutex.Lock()
	defer fake.pruneScalingHistoriesMutex.Unlock()
	fake.PruneScalingHistoriesStub = stub
}

func (fake *FakeScalingEngineDB) PruneScalingHistoriesArgsForCall(i int) int64 {
	fake.pruneScalingHistoriesMutex.RLock()
	defer fake.pruneScalingHistoriesMutex.RUnlock()
	argsForCall := fake.pruneScalingHistoriesArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeScalingEngineDB) PruneScalingHistoriesReturns(result1 error) {
	fake.pruneScalingHistoriesMutex.Lock()
	defer fake.pruneScalingHistoriesMutex.Unlock()
	fake.PruneScalingHistoriesStub = nil
	fake.pruneScalingHistoriesReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) PruneScalingHistoriesReturnsOnCall(i int, result1 error) {
	fake.pruneScalingHistoriesMutex.Lock()
	defer fake.pruneScalingHistoriesMutex.Unlock()
	fake.PruneScalingHistoriesStub = nil
	if fake.pruneScalingHistoriesReturnsOnCall == nil {
		fake.pruneScalingHistoriesReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.pruneScalingHistoriesReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) RemoveActiveSchedule(arg1 string) error {
	fake.removeActiveScheduleMutex.Lock()
	ret, specificReturn := fake.removeActiveScheduleReturnsOnCall[len(fake.removeActiveScheduleArgsForCall)]
	fake.removeActiveScheduleArgsForCall = append(fake.removeActiveScheduleArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.RemoveActiveScheduleStub
	fakeReturns := fake.removeActiveScheduleReturns
	fake.recordInvocation("RemoveActiveSchedule", []interface{}{arg1})
	fake.removeActiveScheduleMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeScalingEngineDB) RemoveActiveScheduleCallCount() int {
	fake.removeActiveScheduleMutex.RLock()
	defer fake.removeActiveScheduleMutex.RUnlock()
	return len(fake.removeActiveScheduleArgsForCall)
}

func (fake *FakeScalingEngineDB) RemoveActiveScheduleCalls(stub func(string) error) {
	fake.removeActiveScheduleMutex.Lock()
	defer fake.removeActiveScheduleMutex.Unlock()
	fake.RemoveActiveScheduleStub = stub
}

func (fake *FakeScalingEngineDB) RemoveActiveScheduleArgsForCall(i int) string {
	fake.removeActiveScheduleMutex.RLock()
	defer fake.removeActiveScheduleMutex.RUnlock()
	argsForCall := fake.removeActiveScheduleArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeScalingEngineDB) RemoveActiveScheduleReturns(result1 error) {
	fake.removeActiveScheduleMutex.Lock()
	defer fake.removeActiveScheduleMutex.Unlock()
	fake.RemoveActiveScheduleStub = nil
	fake.removeActiveScheduleReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) RemoveActiveScheduleReturnsOnCall(i int, result1 error) {
	fake.removeActiveScheduleMutex.Lock()
	defer fake.removeActiveScheduleMutex.Unlock()
	fake.RemoveActiveScheduleStub = nil
	if fake.removeActiveScheduleReturnsOnCall == nil {
		fake.removeActiveScheduleReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.removeActiveScheduleReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) RetrieveScalingHistories(arg1 string, arg2 int64, arg3 int64, arg4 db.OrderType, arg5 bool) ([]*models.AppScalingHistory, error) {
	fake.retrieveScalingHistoriesMutex.Lock()
	ret, specificReturn := fake.retrieveScalingHistoriesReturnsOnCall[len(fake.retrieveScalingHistoriesArgsForCall)]
	fake.retrieveScalingHistoriesArgsForCall = append(fake.retrieveScalingHistoriesArgsForCall, struct {
		arg1 string
		arg2 int64
		arg3 int64
		arg4 db.OrderType
		arg5 bool
	}{arg1, arg2, arg3, arg4, arg5})
	stub := fake.RetrieveScalingHistoriesStub
	fakeReturns := fake.retrieveScalingHistoriesReturns
	fake.recordInvocation("RetrieveScalingHistories", []interface{}{arg1, arg2, arg3, arg4, arg5})
	fake.retrieveScalingHistoriesMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4, arg5)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeScalingEngineDB) RetrieveScalingHistoriesCallCount() int {
	fake.retrieveScalingHistoriesMutex.RLock()
	defer fake.retrieveScalingHistoriesMutex.RUnlock()
	return len(fake.retrieveScalingHistoriesArgsForCall)
}

func (fake *FakeScalingEngineDB) RetrieveScalingHistoriesCalls(stub func(string, int64, int64, db.OrderType, bool) ([]*models.AppScalingHistory, error)) {
	fake.retrieveScalingHistoriesMutex.Lock()
	defer fake.retrieveScalingHistoriesMutex.Unlock()
	fake.RetrieveScalingHistoriesStub = stub
}

func (fake *FakeScalingEngineDB) RetrieveScalingHistoriesArgsForCall(i int) (string, int64, int64, db.OrderType, bool) {
	fake.retrieveScalingHistoriesMutex.RLock()
	defer fake.retrieveScalingHistoriesMutex.RUnlock()
	argsForCall := fake.retrieveScalingHistoriesArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
}

func (fake *FakeScalingEngineDB) RetrieveScalingHistoriesReturns(result1 []*models.AppScalingHistory, result2 error) {
	fake.retrieveScalingHistoriesMutex.Lock()
	defer fake.retrieveScalingHistoriesMutex.Unlock()
	fake.RetrieveScalingHistoriesStub = nil
	fake.retrieveScalingHistoriesReturns = struct {
		result1 []*models.AppScalingHistory
		result2 error
	}{result1, result2}
}

func (fake *FakeScalingEngineDB) RetrieveScalingHistoriesReturnsOnCall(i int, result1 []*models.AppScalingHistory, result2 error) {
	fake.retrieveScalingHistoriesMutex.Lock()
	defer fake.retrieveScalingHistoriesMutex.Unlock()
	fake.RetrieveScalingHistoriesStub = nil
	if fake.retrieveScalingHistoriesReturnsOnCall == nil {
		fake.retrieveScalingHistoriesReturnsOnCall = make(map[int]struct {
			result1 []*models.AppScalingHistory
			result2 error
		})
	}
	fake.retrieveScalingHistoriesReturnsOnCall[i] = struct {
		result1 []*models.AppScalingHistory
		result2 error
	}{result1, result2}
}

func (fake *FakeScalingEngineDB) SaveScalingHistory(arg1 *models.AppScalingHistory) error {
	fake.saveScalingHistoryMutex.Lock()
	ret, specificReturn := fake.saveScalingHistoryReturnsOnCall[len(fake.saveScalingHistoryArgsForCall)]
	fake.saveScalingHistoryArgsForCall = append(fake.saveScalingHistoryArgsForCall, struct {
		arg1 *models.AppScalingHistory
	}{arg1})
	stub := fake.SaveScalingHistoryStub
	fakeReturns := fake.saveScalingHistoryReturns
	fake.recordInvocation("SaveScalingHistory", []interface{}{arg1})
	fake.saveScalingHistoryMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeScalingEngineDB) SaveScalingHistoryCallCount() int {
	fake.saveScalingHistoryMutex.RLock()
	defer fake.saveScalingHistoryMutex.RUnlock()
	return len(fake.saveScalingHistoryArgsForCall)
}

func (fake *FakeScalingEngineDB) SaveScalingHistoryCalls(stub func(*models.AppScalingHistory) error) {
	fake.saveScalingHistoryMutex.Lock()
	defer fake.saveScalingHistoryMutex.Unlock()
	fake.SaveScalingHistoryStub = stub
}

func (fake *FakeScalingEngineDB) SaveScalingHistoryArgsForCall(i int) *models.AppScalingHistory {
	fake.saveScalingHistoryMutex.RLock()
	defer fake.saveScalingHistoryMutex.RUnlock()
	argsForCall := fake.saveScalingHistoryArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeScalingEngineDB) SaveScalingHistoryReturns(result1 error) {
	fake.saveScalingHistoryMutex.Lock()
	defer fake.saveScalingHistoryMutex.Unlock()
	fake.SaveScalingHistoryStub = nil
	fake.saveScalingHistoryReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) SaveScalingHistoryReturnsOnCall(i int, result1 error) {
	fake.saveScalingHistoryMutex.Lock()
	defer fake.saveScalingHistoryMutex.Unlock()
	fake.SaveScalingHistoryStub = nil
	if fake.saveScalingHistoryReturnsOnCall == nil {
		fake.saveScalingHistoryReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.saveScalingHistoryReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) SetActiveSchedule(arg1 string, arg2 *models.ActiveSchedule) error {
	fake.setActiveScheduleMutex.Lock()
	ret, specificReturn := fake.setActiveScheduleReturnsOnCall[len(fake.setActiveScheduleArgsForCall)]
	fake.setActiveScheduleArgsForCall = append(fake.setActiveScheduleArgsForCall, struct {
		arg1 string
		arg2 *models.ActiveSchedule
	}{arg1, arg2})
	stub := fake.SetActiveScheduleStub
	fakeReturns := fake.setActiveScheduleReturns
	fake.recordInvocation("SetActiveSchedule", []interface{}{arg1, arg2})
	fake.setActiveScheduleMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeScalingEngineDB) SetActiveScheduleCallCount() int {
	fake.setActiveScheduleMutex.RLock()
	defer fake.setActiveScheduleMutex.RUnlock()
	return len(fake.setActiveScheduleArgsForCall)
}

func (fake *FakeScalingEngineDB) SetActiveScheduleCalls(stub func(string, *models.ActiveSchedule) error) {
	fake.setActiveScheduleMutex.Lock()
	defer fake.setActiveScheduleMutex.Unlock()
	fake.SetActiveScheduleStub = stub
}

func (fake *FakeScalingEngineDB) SetActiveScheduleArgsForCall(i int) (string, *models.ActiveSchedule) {
	fake.setActiveScheduleMutex.RLock()
	defer fake.setActiveScheduleMutex.RUnlock()
	argsForCall := fake.setActiveScheduleArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeScalingEngineDB) SetActiveScheduleReturns(result1 error) {
	fake.setActiveScheduleMutex.Lock()
	defer fake.setActiveScheduleMutex.Unlock()
	fake.SetActiveScheduleStub = nil
	fake.setActiveScheduleReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) SetActiveScheduleReturnsOnCall(i int, result1 error) {
	fake.setActiveScheduleMutex.Lock()
	defer fake.setActiveScheduleMutex.Unlock()
	fake.SetActiveScheduleStub = nil
	if fake.setActiveScheduleReturnsOnCall == nil {
		fake.setActiveScheduleReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.setActiveScheduleReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) UpdateScalingCooldownExpireTime(arg1 string, arg2 int64) error {
	fake.updateScalingCooldownExpireTimeMutex.Lock()
	ret, specificReturn := fake.updateScalingCooldownExpireTimeReturnsOnCall[len(fake.updateScalingCooldownExpireTimeArgsForCall)]
	fake.updateScalingCooldownExpireTimeArgsForCall = append(fake.updateScalingCooldownExpireTimeArgsForCall, struct {
		arg1 string
		arg2 int64
	}{arg1, arg2})
	stub := fake.UpdateScalingCooldownExpireTimeStub
	fakeReturns := fake.updateScalingCooldownExpireTimeReturns
	fake.recordInvocation("UpdateScalingCooldownExpireTime", []interface{}{arg1, arg2})
	fake.updateScalingCooldownExpireTimeMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeScalingEngineDB) UpdateScalingCooldownExpireTimeCallCount() int {
	fake.updateScalingCooldownExpireTimeMutex.RLock()
	defer fake.updateScalingCooldownExpireTimeMutex.RUnlock()
	return len(fake.updateScalingCooldownExpireTimeArgsForCall)
}

func (fake *FakeScalingEngineDB) UpdateScalingCooldownExpireTimeCalls(stub func(string, int64) error) {
	fake.updateScalingCooldownExpireTimeMutex.Lock()
	defer fake.updateScalingCooldownExpireTimeMutex.Unlock()
	fake.UpdateScalingCooldownExpireTimeStub = stub
}

func (fake *FakeScalingEngineDB) UpdateScalingCooldownExpireTimeArgsForCall(i int) (string, int64) {
	fake.updateScalingCooldownExpireTimeMutex.RLock()
	defer fake.updateScalingCooldownExpireTimeMutex.RUnlock()
	argsForCall := fake.updateScalingCooldownExpireTimeArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeScalingEngineDB) UpdateScalingCooldownExpireTimeReturns(result1 error) {
	fake.updateScalingCooldownExpireTimeMutex.Lock()
	defer fake.updateScalingCooldownExpireTimeMutex.Unlock()
	fake.UpdateScalingCooldownExpireTimeStub = nil
	fake.updateScalingCooldownExpireTimeReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) UpdateScalingCooldownExpireTimeReturnsOnCall(i int, result1 error) {
	fake.updateScalingCooldownExpireTimeMutex.Lock()
	defer fake.updateScalingCooldownExpireTimeMutex.Unlock()
	fake.UpdateScalingCooldownExpireTimeStub = nil
	if fake.updateScalingCooldownExpireTimeReturnsOnCall == nil {
		fake.updateScalingCooldownExpireTimeReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.updateScalingCooldownExpireTimeReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngineDB) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.canScaleAppMutex.RLock()
	defer fake.canScaleAppMutex.RUnlock()
	fake.closeMutex.RLock()
	defer fake.closeMutex.RUnlock()
	fake.getActiveScheduleMutex.RLock()
	defer fake.getActiveScheduleMutex.RUnlock()
	fake.getActiveSchedulesMutex.RLock()
	defer fake.getActiveSchedulesMutex.RUnlock()
	fake.getDBStatusMutex.RLock()
	defer fake.getDBStatusMutex.RUnlock()
	fake.pruneScalingHistoriesMutex.RLock()
	defer fake.pruneScalingHistoriesMutex.RUnlock()
	fake.removeActiveScheduleMutex.RLock()
	defer fake.removeActiveScheduleMutex.RUnlock()
	fake.retrieveScalingHistoriesMutex.RLock()
	defer fake.retrieveScalingHistoriesMutex.RUnlock()
	fake.saveScalingHistoryMutex.RLock()
	defer fake.saveScalingHistoryMutex.RUnlock()
	fake.setActiveScheduleMutex.RLock()
	defer fake.setActiveScheduleMutex.RUnlock()
	fake.updateScalingCooldownExpireTimeMutex.RLock()
	defer fake.updateScalingCooldownExpireTimeMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeScalingEngineDB) 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 _ db.ScalingEngineDB = new(FakeScalingEngineDB)
