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

import (
	"policy-server/store/migrations"
	"sync"

	migrate "github.com/cf-container-networking/sql-migrate"
)

type MigrateAdapter struct {
	ExecMaxStub        func(db migrations.MigrationDb, dialect string, m migrate.MigrationSource, dir migrate.MigrationDirection, maxNumMigrations int) (int, error)
	execMaxMutex       sync.RWMutex
	execMaxArgsForCall []struct {
		db               migrations.MigrationDb
		dialect          string
		m                migrate.MigrationSource
		dir              migrate.MigrationDirection
		maxNumMigrations int
	}
	execMaxReturns struct {
		result1 int
		result2 error
	}
	execMaxReturnsOnCall map[int]struct {
		result1 int
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *MigrateAdapter) ExecMax(db migrations.MigrationDb, dialect string, m migrate.MigrationSource, dir migrate.MigrationDirection, maxNumMigrations int) (int, error) {
	fake.execMaxMutex.Lock()
	ret, specificReturn := fake.execMaxReturnsOnCall[len(fake.execMaxArgsForCall)]
	fake.execMaxArgsForCall = append(fake.execMaxArgsForCall, struct {
		db               migrations.MigrationDb
		dialect          string
		m                migrate.MigrationSource
		dir              migrate.MigrationDirection
		maxNumMigrations int
	}{db, dialect, m, dir, maxNumMigrations})
	fake.recordInvocation("ExecMax", []interface{}{db, dialect, m, dir, maxNumMigrations})
	fake.execMaxMutex.Unlock()
	if fake.ExecMaxStub != nil {
		return fake.ExecMaxStub(db, dialect, m, dir, maxNumMigrations)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.execMaxReturns.result1, fake.execMaxReturns.result2
}

func (fake *MigrateAdapter) ExecMaxCallCount() int {
	fake.execMaxMutex.RLock()
	defer fake.execMaxMutex.RUnlock()
	return len(fake.execMaxArgsForCall)
}

func (fake *MigrateAdapter) ExecMaxArgsForCall(i int) (migrations.MigrationDb, string, migrate.MigrationSource, migrate.MigrationDirection, int) {
	fake.execMaxMutex.RLock()
	defer fake.execMaxMutex.RUnlock()
	return fake.execMaxArgsForCall[i].db, fake.execMaxArgsForCall[i].dialect, fake.execMaxArgsForCall[i].m, fake.execMaxArgsForCall[i].dir, fake.execMaxArgsForCall[i].maxNumMigrations
}

func (fake *MigrateAdapter) ExecMaxReturns(result1 int, result2 error) {
	fake.ExecMaxStub = nil
	fake.execMaxReturns = struct {
		result1 int
		result2 error
	}{result1, result2}
}

func (fake *MigrateAdapter) ExecMaxReturnsOnCall(i int, result1 int, result2 error) {
	fake.ExecMaxStub = nil
	if fake.execMaxReturnsOnCall == nil {
		fake.execMaxReturnsOnCall = make(map[int]struct {
			result1 int
			result2 error
		})
	}
	fake.execMaxReturnsOnCall[i] = struct {
		result1 int
		result2 error
	}{result1, result2}
}

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

func (fake *MigrateAdapter) 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)
}
