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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/eirini/migrations"
	"k8s.io/apimachinery/pkg/runtime"
)

type FakeMigrationStep struct {
	AppliesToStub        func() migrations.ObjectType
	appliesToMutex       sync.RWMutex
	appliesToArgsForCall []struct {
	}
	appliesToReturns struct {
		result1 migrations.ObjectType
	}
	appliesToReturnsOnCall map[int]struct {
		result1 migrations.ObjectType
	}
	ApplyStub        func(context.Context, runtime.Object) error
	applyMutex       sync.RWMutex
	applyArgsForCall []struct {
		arg1 context.Context
		arg2 runtime.Object
	}
	applyReturns struct {
		result1 error
	}
	applyReturnsOnCall map[int]struct {
		result1 error
	}
	SequenceIDStub        func() int
	sequenceIDMutex       sync.RWMutex
	sequenceIDArgsForCall []struct {
	}
	sequenceIDReturns struct {
		result1 int
	}
	sequenceIDReturnsOnCall map[int]struct {
		result1 int
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeMigrationStep) AppliesTo() migrations.ObjectType {
	fake.appliesToMutex.Lock()
	ret, specificReturn := fake.appliesToReturnsOnCall[len(fake.appliesToArgsForCall)]
	fake.appliesToArgsForCall = append(fake.appliesToArgsForCall, struct {
	}{})
	stub := fake.AppliesToStub
	fakeReturns := fake.appliesToReturns
	fake.recordInvocation("AppliesTo", []interface{}{})
	fake.appliesToMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeMigrationStep) AppliesToCallCount() int {
	fake.appliesToMutex.RLock()
	defer fake.appliesToMutex.RUnlock()
	return len(fake.appliesToArgsForCall)
}

func (fake *FakeMigrationStep) AppliesToCalls(stub func() migrations.ObjectType) {
	fake.appliesToMutex.Lock()
	defer fake.appliesToMutex.Unlock()
	fake.AppliesToStub = stub
}

func (fake *FakeMigrationStep) AppliesToReturns(result1 migrations.ObjectType) {
	fake.appliesToMutex.Lock()
	defer fake.appliesToMutex.Unlock()
	fake.AppliesToStub = nil
	fake.appliesToReturns = struct {
		result1 migrations.ObjectType
	}{result1}
}

func (fake *FakeMigrationStep) AppliesToReturnsOnCall(i int, result1 migrations.ObjectType) {
	fake.appliesToMutex.Lock()
	defer fake.appliesToMutex.Unlock()
	fake.AppliesToStub = nil
	if fake.appliesToReturnsOnCall == nil {
		fake.appliesToReturnsOnCall = make(map[int]struct {
			result1 migrations.ObjectType
		})
	}
	fake.appliesToReturnsOnCall[i] = struct {
		result1 migrations.ObjectType
	}{result1}
}

func (fake *FakeMigrationStep) Apply(arg1 context.Context, arg2 runtime.Object) error {
	fake.applyMutex.Lock()
	ret, specificReturn := fake.applyReturnsOnCall[len(fake.applyArgsForCall)]
	fake.applyArgsForCall = append(fake.applyArgsForCall, struct {
		arg1 context.Context
		arg2 runtime.Object
	}{arg1, arg2})
	stub := fake.ApplyStub
	fakeReturns := fake.applyReturns
	fake.recordInvocation("Apply", []interface{}{arg1, arg2})
	fake.applyMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeMigrationStep) ApplyCallCount() int {
	fake.applyMutex.RLock()
	defer fake.applyMutex.RUnlock()
	return len(fake.applyArgsForCall)
}

func (fake *FakeMigrationStep) ApplyCalls(stub func(context.Context, runtime.Object) error) {
	fake.applyMutex.Lock()
	defer fake.applyMutex.Unlock()
	fake.ApplyStub = stub
}

func (fake *FakeMigrationStep) ApplyArgsForCall(i int) (context.Context, runtime.Object) {
	fake.applyMutex.RLock()
	defer fake.applyMutex.RUnlock()
	argsForCall := fake.applyArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeMigrationStep) ApplyReturns(result1 error) {
	fake.applyMutex.Lock()
	defer fake.applyMutex.Unlock()
	fake.ApplyStub = nil
	fake.applyReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeMigrationStep) ApplyReturnsOnCall(i int, result1 error) {
	fake.applyMutex.Lock()
	defer fake.applyMutex.Unlock()
	fake.ApplyStub = nil
	if fake.applyReturnsOnCall == nil {
		fake.applyReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.applyReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeMigrationStep) SequenceID() int {
	fake.sequenceIDMutex.Lock()
	ret, specificReturn := fake.sequenceIDReturnsOnCall[len(fake.sequenceIDArgsForCall)]
	fake.sequenceIDArgsForCall = append(fake.sequenceIDArgsForCall, struct {
	}{})
	stub := fake.SequenceIDStub
	fakeReturns := fake.sequenceIDReturns
	fake.recordInvocation("SequenceID", []interface{}{})
	fake.sequenceIDMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeMigrationStep) SequenceIDCallCount() int {
	fake.sequenceIDMutex.RLock()
	defer fake.sequenceIDMutex.RUnlock()
	return len(fake.sequenceIDArgsForCall)
}

func (fake *FakeMigrationStep) SequenceIDCalls(stub func() int) {
	fake.sequenceIDMutex.Lock()
	defer fake.sequenceIDMutex.Unlock()
	fake.SequenceIDStub = stub
}

func (fake *FakeMigrationStep) SequenceIDReturns(result1 int) {
	fake.sequenceIDMutex.Lock()
	defer fake.sequenceIDMutex.Unlock()
	fake.SequenceIDStub = nil
	fake.sequenceIDReturns = struct {
		result1 int
	}{result1}
}

func (fake *FakeMigrationStep) SequenceIDReturnsOnCall(i int, result1 int) {
	fake.sequenceIDMutex.Lock()
	defer fake.sequenceIDMutex.Unlock()
	fake.SequenceIDStub = nil
	if fake.sequenceIDReturnsOnCall == nil {
		fake.sequenceIDReturnsOnCall = make(map[int]struct {
			result1 int
		})
	}
	fake.sequenceIDReturnsOnCall[i] = struct {
		result1 int
	}{result1}
}

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

func (fake *FakeMigrationStep) 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 _ migrations.MigrationStep = new(FakeMigrationStep)
