mock

package
v0.0.0-pre.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchRepoMock

type BatchRepoMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, batch migration.Batch) (int64, error)

	// DeleteByNameFunc mocks the DeleteByName method.
	DeleteByNameFunc func(ctx context.Context, name string) error

	// GetAllFunc mocks the GetAll method.
	GetAllFunc func(ctx context.Context) (migration.Batches, error)

	// GetAllByStateFunc mocks the GetAllByState method.
	GetAllByStateFunc func(ctx context.Context, status api.BatchStatusType) (migration.Batches, error)

	// GetAllNamesFunc mocks the GetAllNames method.
	GetAllNamesFunc func(ctx context.Context) ([]string, error)

	// GetAllNamesByStateFunc mocks the GetAllNamesByState method.
	GetAllNamesByStateFunc func(ctx context.Context, status api.BatchStatusType) ([]string, error)

	// GetByNameFunc mocks the GetByName method.
	GetByNameFunc func(ctx context.Context, name string) (*migration.Batch, error)

	// RenameFunc mocks the Rename method.
	RenameFunc func(ctx context.Context, oldName string, newName string) error

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, name string, batch migration.Batch) error
	// contains filtered or unexported fields
}

BatchRepoMock is a mock implementation of migration.BatchRepo.

func TestSomethingThatUsesBatchRepo(t *testing.T) {

	// make and configure a mocked migration.BatchRepo
	mockedBatchRepo := &BatchRepoMock{
		CreateFunc: func(ctx context.Context, batch migration.Batch) (int64, error) {
			panic("mock out the Create method")
		},
		DeleteByNameFunc: func(ctx context.Context, name string) error {
			panic("mock out the DeleteByName method")
		},
		GetAllFunc: func(ctx context.Context) (migration.Batches, error) {
			panic("mock out the GetAll method")
		},
		GetAllByStateFunc: func(ctx context.Context, status api.BatchStatusType) (migration.Batches, error) {
			panic("mock out the GetAllByState method")
		},
		GetAllNamesFunc: func(ctx context.Context) ([]string, error) {
			panic("mock out the GetAllNames method")
		},
		GetAllNamesByStateFunc: func(ctx context.Context, status api.BatchStatusType) ([]string, error) {
			panic("mock out the GetAllNamesByState method")
		},
		GetByNameFunc: func(ctx context.Context, name string) (*migration.Batch, error) {
			panic("mock out the GetByName method")
		},
		RenameFunc: func(ctx context.Context, oldName string, newName string) error {
			panic("mock out the Rename method")
		},
		UpdateFunc: func(ctx context.Context, name string, batch migration.Batch) error {
			panic("mock out the Update method")
		},
	}

	// use mockedBatchRepo in code that requires migration.BatchRepo
	// and then make assertions.

}

func (*BatchRepoMock) Create

func (mock *BatchRepoMock) Create(ctx context.Context, batch migration.Batch) (int64, error)

Create calls CreateFunc.

func (*BatchRepoMock) CreateCalls

func (mock *BatchRepoMock) CreateCalls() []struct {
	Ctx   context.Context
	Batch migration.Batch
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedBatchRepo.CreateCalls())

func (*BatchRepoMock) DeleteByName

func (mock *BatchRepoMock) DeleteByName(ctx context.Context, name string) error

DeleteByName calls DeleteByNameFunc.

func (*BatchRepoMock) DeleteByNameCalls

func (mock *BatchRepoMock) DeleteByNameCalls() []struct {
	Ctx  context.Context
	Name string
}

DeleteByNameCalls gets all the calls that were made to DeleteByName. Check the length with:

len(mockedBatchRepo.DeleteByNameCalls())

func (*BatchRepoMock) GetAll

func (mock *BatchRepoMock) GetAll(ctx context.Context) (migration.Batches, error)

GetAll calls GetAllFunc.

func (*BatchRepoMock) GetAllByState

func (mock *BatchRepoMock) GetAllByState(ctx context.Context, status api.BatchStatusType) (migration.Batches, error)

GetAllByState calls GetAllByStateFunc.

func (*BatchRepoMock) GetAllByStateCalls

func (mock *BatchRepoMock) GetAllByStateCalls() []struct {
	Ctx    context.Context
	Status api.BatchStatusType
}

GetAllByStateCalls gets all the calls that were made to GetAllByState. Check the length with:

len(mockedBatchRepo.GetAllByStateCalls())

func (*BatchRepoMock) GetAllCalls

func (mock *BatchRepoMock) GetAllCalls() []struct {
	Ctx context.Context
}

GetAllCalls gets all the calls that were made to GetAll. Check the length with:

len(mockedBatchRepo.GetAllCalls())

func (*BatchRepoMock) GetAllNames

func (mock *BatchRepoMock) GetAllNames(ctx context.Context) ([]string, error)

GetAllNames calls GetAllNamesFunc.

func (*BatchRepoMock) GetAllNamesByState

func (mock *BatchRepoMock) GetAllNamesByState(ctx context.Context, status api.BatchStatusType) ([]string, error)

GetAllNamesByState calls GetAllNamesByStateFunc.

func (*BatchRepoMock) GetAllNamesByStateCalls

func (mock *BatchRepoMock) GetAllNamesByStateCalls() []struct {
	Ctx    context.Context
	Status api.BatchStatusType
}

GetAllNamesByStateCalls gets all the calls that were made to GetAllNamesByState. Check the length with:

len(mockedBatchRepo.GetAllNamesByStateCalls())

func (*BatchRepoMock) GetAllNamesCalls

func (mock *BatchRepoMock) GetAllNamesCalls() []struct {
	Ctx context.Context
}

GetAllNamesCalls gets all the calls that were made to GetAllNames. Check the length with:

len(mockedBatchRepo.GetAllNamesCalls())

func (*BatchRepoMock) GetByName

func (mock *BatchRepoMock) GetByName(ctx context.Context, name string) (*migration.Batch, error)

GetByName calls GetByNameFunc.

func (*BatchRepoMock) GetByNameCalls

func (mock *BatchRepoMock) GetByNameCalls() []struct {
	Ctx  context.Context
	Name string
}

GetByNameCalls gets all the calls that were made to GetByName. Check the length with:

len(mockedBatchRepo.GetByNameCalls())

func (*BatchRepoMock) Rename

func (mock *BatchRepoMock) Rename(ctx context.Context, oldName string, newName string) error

Rename calls RenameFunc.

func (*BatchRepoMock) RenameCalls

func (mock *BatchRepoMock) RenameCalls() []struct {
	Ctx     context.Context
	OldName string
	NewName string
}

RenameCalls gets all the calls that were made to Rename. Check the length with:

len(mockedBatchRepo.RenameCalls())

func (*BatchRepoMock) Update

func (mock *BatchRepoMock) Update(ctx context.Context, name string, batch migration.Batch) error

Update calls UpdateFunc.

func (*BatchRepoMock) UpdateCalls

func (mock *BatchRepoMock) UpdateCalls() []struct {
	Ctx   context.Context
	Name  string
	Batch migration.Batch
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedBatchRepo.UpdateCalls())

type InstanceRepoMock

type InstanceRepoMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, instance migration.Instance) (int64, error)

	// CreateOverridesFunc mocks the CreateOverrides method.
	CreateOverridesFunc func(ctx context.Context, overrides migration.InstanceOverride) (int64, error)

	// DeleteByUUIDFunc mocks the DeleteByUUID method.
	DeleteByUUIDFunc func(ctx context.Context, id uuid.UUID) error

	// DeleteOverridesByUUIDFunc mocks the DeleteOverridesByUUID method.
	DeleteOverridesByUUIDFunc func(ctx context.Context, id uuid.UUID) error

	// GetAllFunc mocks the GetAll method.
	GetAllFunc func(ctx context.Context) (migration.Instances, error)

	// GetAllByBatchFunc mocks the GetAllByBatch method.
	GetAllByBatchFunc func(ctx context.Context, batch string) (migration.Instances, error)

	// GetAllByBatchAndStateFunc mocks the GetAllByBatchAndState method.
	GetAllByBatchAndStateFunc func(ctx context.Context, batch string, status api.MigrationStatusType) (migration.Instances, error)

	// GetAllBySourceFunc mocks the GetAllBySource method.
	GetAllBySourceFunc func(ctx context.Context, source string) (migration.Instances, error)

	// GetAllByStateFunc mocks the GetAllByState method.
	GetAllByStateFunc func(ctx context.Context, status ...api.MigrationStatusType) (migration.Instances, error)

	// GetAllUUIDsFunc mocks the GetAllUUIDs method.
	GetAllUUIDsFunc func(ctx context.Context) ([]uuid.UUID, error)

	// GetAllUnassignedFunc mocks the GetAllUnassigned method.
	GetAllUnassignedFunc func(ctx context.Context) (migration.Instances, error)

	// GetByUUIDFunc mocks the GetByUUID method.
	GetByUUIDFunc func(ctx context.Context, id uuid.UUID) (*migration.Instance, error)

	// GetOverridesByUUIDFunc mocks the GetOverridesByUUID method.
	GetOverridesByUUIDFunc func(ctx context.Context, id uuid.UUID) (*migration.InstanceOverride, error)

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, instance migration.Instance) error

	// UpdateOverridesFunc mocks the UpdateOverrides method.
	UpdateOverridesFunc func(ctx context.Context, overrides migration.InstanceOverride) error
	// contains filtered or unexported fields
}

InstanceRepoMock is a mock implementation of migration.InstanceRepo.

func TestSomethingThatUsesInstanceRepo(t *testing.T) {

	// make and configure a mocked migration.InstanceRepo
	mockedInstanceRepo := &InstanceRepoMock{
		CreateFunc: func(ctx context.Context, instance migration.Instance) (int64, error) {
			panic("mock out the Create method")
		},
		CreateOverridesFunc: func(ctx context.Context, overrides migration.InstanceOverride) (int64, error) {
			panic("mock out the CreateOverrides method")
		},
		DeleteByUUIDFunc: func(ctx context.Context, id uuid.UUID) error {
			panic("mock out the DeleteByUUID method")
		},
		DeleteOverridesByUUIDFunc: func(ctx context.Context, id uuid.UUID) error {
			panic("mock out the DeleteOverridesByUUID method")
		},
		GetAllFunc: func(ctx context.Context) (migration.Instances, error) {
			panic("mock out the GetAll method")
		},
		GetAllByBatchFunc: func(ctx context.Context, batch string) (migration.Instances, error) {
			panic("mock out the GetAllByBatch method")
		},
		GetAllByBatchAndStateFunc: func(ctx context.Context, batch string, status api.MigrationStatusType) (migration.Instances, error) {
			panic("mock out the GetAllByBatchAndState method")
		},
		GetAllBySourceFunc: func(ctx context.Context, source string) (migration.Instances, error) {
			panic("mock out the GetAllBySource method")
		},
		GetAllByStateFunc: func(ctx context.Context, status ...api.MigrationStatusType) (migration.Instances, error) {
			panic("mock out the GetAllByState method")
		},
		GetAllUUIDsFunc: func(ctx context.Context) ([]uuid.UUID, error) {
			panic("mock out the GetAllUUIDs method")
		},
		GetAllUnassignedFunc: func(ctx context.Context) (migration.Instances, error) {
			panic("mock out the GetAllUnassigned method")
		},
		GetByUUIDFunc: func(ctx context.Context, id uuid.UUID) (*migration.Instance, error) {
			panic("mock out the GetByUUID method")
		},
		GetOverridesByUUIDFunc: func(ctx context.Context, id uuid.UUID) (*migration.InstanceOverride, error) {
			panic("mock out the GetOverridesByUUID method")
		},
		UpdateFunc: func(ctx context.Context, instance migration.Instance) error {
			panic("mock out the Update method")
		},
		UpdateOverridesFunc: func(ctx context.Context, overrides migration.InstanceOverride) error {
			panic("mock out the UpdateOverrides method")
		},
	}

	// use mockedInstanceRepo in code that requires migration.InstanceRepo
	// and then make assertions.

}

func (*InstanceRepoMock) Create

func (mock *InstanceRepoMock) Create(ctx context.Context, instance migration.Instance) (int64, error)

Create calls CreateFunc.

func (*InstanceRepoMock) CreateCalls

func (mock *InstanceRepoMock) CreateCalls() []struct {
	Ctx      context.Context
	Instance migration.Instance
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedInstanceRepo.CreateCalls())

func (*InstanceRepoMock) CreateOverrides

func (mock *InstanceRepoMock) CreateOverrides(ctx context.Context, overrides migration.InstanceOverride) (int64, error)

CreateOverrides calls CreateOverridesFunc.

func (*InstanceRepoMock) CreateOverridesCalls

func (mock *InstanceRepoMock) CreateOverridesCalls() []struct {
	Ctx       context.Context
	Overrides migration.InstanceOverride
}

CreateOverridesCalls gets all the calls that were made to CreateOverrides. Check the length with:

len(mockedInstanceRepo.CreateOverridesCalls())

func (*InstanceRepoMock) DeleteByUUID

func (mock *InstanceRepoMock) DeleteByUUID(ctx context.Context, id uuid.UUID) error

DeleteByUUID calls DeleteByUUIDFunc.

func (*InstanceRepoMock) DeleteByUUIDCalls

func (mock *InstanceRepoMock) DeleteByUUIDCalls() []struct {
	Ctx context.Context
	ID  uuid.UUID
}

DeleteByUUIDCalls gets all the calls that were made to DeleteByUUID. Check the length with:

len(mockedInstanceRepo.DeleteByUUIDCalls())

func (*InstanceRepoMock) DeleteOverridesByUUID

func (mock *InstanceRepoMock) DeleteOverridesByUUID(ctx context.Context, id uuid.UUID) error

DeleteOverridesByUUID calls DeleteOverridesByUUIDFunc.

func (*InstanceRepoMock) DeleteOverridesByUUIDCalls

func (mock *InstanceRepoMock) DeleteOverridesByUUIDCalls() []struct {
	Ctx context.Context
	ID  uuid.UUID
}

DeleteOverridesByUUIDCalls gets all the calls that were made to DeleteOverridesByUUID. Check the length with:

len(mockedInstanceRepo.DeleteOverridesByUUIDCalls())

func (*InstanceRepoMock) GetAll

GetAll calls GetAllFunc.

func (*InstanceRepoMock) GetAllByBatch

func (mock *InstanceRepoMock) GetAllByBatch(ctx context.Context, batch string) (migration.Instances, error)

GetAllByBatch calls GetAllByBatchFunc.

func (*InstanceRepoMock) GetAllByBatchAndState

func (mock *InstanceRepoMock) GetAllByBatchAndState(ctx context.Context, batch string, status api.MigrationStatusType) (migration.Instances, error)

GetAllByBatchAndState calls GetAllByBatchAndStateFunc.

func (*InstanceRepoMock) GetAllByBatchAndStateCalls

func (mock *InstanceRepoMock) GetAllByBatchAndStateCalls() []struct {
	Ctx    context.Context
	Batch  string
	Status api.MigrationStatusType
}

GetAllByBatchAndStateCalls gets all the calls that were made to GetAllByBatchAndState. Check the length with:

len(mockedInstanceRepo.GetAllByBatchAndStateCalls())

func (*InstanceRepoMock) GetAllByBatchCalls

func (mock *InstanceRepoMock) GetAllByBatchCalls() []struct {
	Ctx   context.Context
	Batch string
}

GetAllByBatchCalls gets all the calls that were made to GetAllByBatch. Check the length with:

len(mockedInstanceRepo.GetAllByBatchCalls())

func (*InstanceRepoMock) GetAllBySource

func (mock *InstanceRepoMock) GetAllBySource(ctx context.Context, source string) (migration.Instances, error)

GetAllBySource calls GetAllBySourceFunc.

func (*InstanceRepoMock) GetAllBySourceCalls

func (mock *InstanceRepoMock) GetAllBySourceCalls() []struct {
	Ctx    context.Context
	Source string
}

GetAllBySourceCalls gets all the calls that were made to GetAllBySource. Check the length with:

len(mockedInstanceRepo.GetAllBySourceCalls())

func (*InstanceRepoMock) GetAllByState

func (mock *InstanceRepoMock) GetAllByState(ctx context.Context, status ...api.MigrationStatusType) (migration.Instances, error)

GetAllByState calls GetAllByStateFunc.

func (*InstanceRepoMock) GetAllByStateCalls

func (mock *InstanceRepoMock) GetAllByStateCalls() []struct {
	Ctx    context.Context
	Status []api.MigrationStatusType
}

GetAllByStateCalls gets all the calls that were made to GetAllByState. Check the length with:

len(mockedInstanceRepo.GetAllByStateCalls())

func (*InstanceRepoMock) GetAllCalls

func (mock *InstanceRepoMock) GetAllCalls() []struct {
	Ctx context.Context
}

GetAllCalls gets all the calls that were made to GetAll. Check the length with:

len(mockedInstanceRepo.GetAllCalls())

func (*InstanceRepoMock) GetAllUUIDs

func (mock *InstanceRepoMock) GetAllUUIDs(ctx context.Context) ([]uuid.UUID, error)

GetAllUUIDs calls GetAllUUIDsFunc.

func (*InstanceRepoMock) GetAllUUIDsCalls

func (mock *InstanceRepoMock) GetAllUUIDsCalls() []struct {
	Ctx context.Context
}

GetAllUUIDsCalls gets all the calls that were made to GetAllUUIDs. Check the length with:

len(mockedInstanceRepo.GetAllUUIDsCalls())

func (*InstanceRepoMock) GetAllUnassigned

func (mock *InstanceRepoMock) GetAllUnassigned(ctx context.Context) (migration.Instances, error)

GetAllUnassigned calls GetAllUnassignedFunc.

func (*InstanceRepoMock) GetAllUnassignedCalls

func (mock *InstanceRepoMock) GetAllUnassignedCalls() []struct {
	Ctx context.Context
}

GetAllUnassignedCalls gets all the calls that were made to GetAllUnassigned. Check the length with:

len(mockedInstanceRepo.GetAllUnassignedCalls())

func (*InstanceRepoMock) GetByUUID

func (mock *InstanceRepoMock) GetByUUID(ctx context.Context, id uuid.UUID) (*migration.Instance, error)

GetByUUID calls GetByUUIDFunc.

func (*InstanceRepoMock) GetByUUIDCalls

func (mock *InstanceRepoMock) GetByUUIDCalls() []struct {
	Ctx context.Context
	ID  uuid.UUID
}

GetByUUIDCalls gets all the calls that were made to GetByUUID. Check the length with:

len(mockedInstanceRepo.GetByUUIDCalls())

func (*InstanceRepoMock) GetOverridesByUUID

func (mock *InstanceRepoMock) GetOverridesByUUID(ctx context.Context, id uuid.UUID) (*migration.InstanceOverride, error)

GetOverridesByUUID calls GetOverridesByUUIDFunc.

func (*InstanceRepoMock) GetOverridesByUUIDCalls

func (mock *InstanceRepoMock) GetOverridesByUUIDCalls() []struct {
	Ctx context.Context
	ID  uuid.UUID
}

GetOverridesByUUIDCalls gets all the calls that were made to GetOverridesByUUID. Check the length with:

len(mockedInstanceRepo.GetOverridesByUUIDCalls())

func (*InstanceRepoMock) Update

func (mock *InstanceRepoMock) Update(ctx context.Context, instance migration.Instance) error

Update calls UpdateFunc.

func (*InstanceRepoMock) UpdateCalls

func (mock *InstanceRepoMock) UpdateCalls() []struct {
	Ctx      context.Context
	Instance migration.Instance
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedInstanceRepo.UpdateCalls())

func (*InstanceRepoMock) UpdateOverrides

func (mock *InstanceRepoMock) UpdateOverrides(ctx context.Context, overrides migration.InstanceOverride) error

UpdateOverrides calls UpdateOverridesFunc.

func (*InstanceRepoMock) UpdateOverridesCalls

func (mock *InstanceRepoMock) UpdateOverridesCalls() []struct {
	Ctx       context.Context
	Overrides migration.InstanceOverride
}

UpdateOverridesCalls gets all the calls that were made to UpdateOverrides. Check the length with:

len(mockedInstanceRepo.UpdateOverridesCalls())

type NetworkRepoMock

type NetworkRepoMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, network migration.Network) (int64, error)

	// DeleteByNameFunc mocks the DeleteByName method.
	DeleteByNameFunc func(ctx context.Context, name string) error

	// GetAllFunc mocks the GetAll method.
	GetAllFunc func(ctx context.Context) (migration.Networks, error)

	// GetAllNamesFunc mocks the GetAllNames method.
	GetAllNamesFunc func(ctx context.Context) ([]string, error)

	// GetByNameFunc mocks the GetByName method.
	GetByNameFunc func(ctx context.Context, name string) (*migration.Network, error)

	// RenameFunc mocks the Rename method.
	RenameFunc func(ctx context.Context, oldName string, newName string) error

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, network migration.Network) error
	// contains filtered or unexported fields
}

NetworkRepoMock is a mock implementation of migration.NetworkRepo.

func TestSomethingThatUsesNetworkRepo(t *testing.T) {

	// make and configure a mocked migration.NetworkRepo
	mockedNetworkRepo := &NetworkRepoMock{
		CreateFunc: func(ctx context.Context, network migration.Network) (int64, error) {
			panic("mock out the Create method")
		},
		DeleteByNameFunc: func(ctx context.Context, name string) error {
			panic("mock out the DeleteByName method")
		},
		GetAllFunc: func(ctx context.Context) (migration.Networks, error) {
			panic("mock out the GetAll method")
		},
		GetAllNamesFunc: func(ctx context.Context) ([]string, error) {
			panic("mock out the GetAllNames method")
		},
		GetByNameFunc: func(ctx context.Context, name string) (*migration.Network, error) {
			panic("mock out the GetByName method")
		},
		RenameFunc: func(ctx context.Context, oldName string, newName string) error {
			panic("mock out the Rename method")
		},
		UpdateFunc: func(ctx context.Context, network migration.Network) error {
			panic("mock out the Update method")
		},
	}

	// use mockedNetworkRepo in code that requires migration.NetworkRepo
	// and then make assertions.

}

func (*NetworkRepoMock) Create

func (mock *NetworkRepoMock) Create(ctx context.Context, network migration.Network) (int64, error)

Create calls CreateFunc.

func (*NetworkRepoMock) CreateCalls

func (mock *NetworkRepoMock) CreateCalls() []struct {
	Ctx     context.Context
	Network migration.Network
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedNetworkRepo.CreateCalls())

func (*NetworkRepoMock) DeleteByName

func (mock *NetworkRepoMock) DeleteByName(ctx context.Context, name string) error

DeleteByName calls DeleteByNameFunc.

func (*NetworkRepoMock) DeleteByNameCalls

func (mock *NetworkRepoMock) DeleteByNameCalls() []struct {
	Ctx  context.Context
	Name string
}

DeleteByNameCalls gets all the calls that were made to DeleteByName. Check the length with:

len(mockedNetworkRepo.DeleteByNameCalls())

func (*NetworkRepoMock) GetAll

func (mock *NetworkRepoMock) GetAll(ctx context.Context) (migration.Networks, error)

GetAll calls GetAllFunc.

func (*NetworkRepoMock) GetAllCalls

func (mock *NetworkRepoMock) GetAllCalls() []struct {
	Ctx context.Context
}

GetAllCalls gets all the calls that were made to GetAll. Check the length with:

len(mockedNetworkRepo.GetAllCalls())

func (*NetworkRepoMock) GetAllNames

func (mock *NetworkRepoMock) GetAllNames(ctx context.Context) ([]string, error)

GetAllNames calls GetAllNamesFunc.

func (*NetworkRepoMock) GetAllNamesCalls

func (mock *NetworkRepoMock) GetAllNamesCalls() []struct {
	Ctx context.Context
}

GetAllNamesCalls gets all the calls that were made to GetAllNames. Check the length with:

len(mockedNetworkRepo.GetAllNamesCalls())

func (*NetworkRepoMock) GetByName

func (mock *NetworkRepoMock) GetByName(ctx context.Context, name string) (*migration.Network, error)

GetByName calls GetByNameFunc.

func (*NetworkRepoMock) GetByNameCalls

func (mock *NetworkRepoMock) GetByNameCalls() []struct {
	Ctx  context.Context
	Name string
}

GetByNameCalls gets all the calls that were made to GetByName. Check the length with:

len(mockedNetworkRepo.GetByNameCalls())

func (*NetworkRepoMock) Rename

func (mock *NetworkRepoMock) Rename(ctx context.Context, oldName string, newName string) error

Rename calls RenameFunc.

func (*NetworkRepoMock) RenameCalls

func (mock *NetworkRepoMock) RenameCalls() []struct {
	Ctx     context.Context
	OldName string
	NewName string
}

RenameCalls gets all the calls that were made to Rename. Check the length with:

len(mockedNetworkRepo.RenameCalls())

func (*NetworkRepoMock) Update

func (mock *NetworkRepoMock) Update(ctx context.Context, network migration.Network) error

Update calls UpdateFunc.

func (*NetworkRepoMock) UpdateCalls

func (mock *NetworkRepoMock) UpdateCalls() []struct {
	Ctx     context.Context
	Network migration.Network
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedNetworkRepo.UpdateCalls())

type SourceRepoMock

type SourceRepoMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, source migration.Source) (int64, error)

	// DeleteByNameFunc mocks the DeleteByName method.
	DeleteByNameFunc func(ctx context.Context, name string) error

	// GetAllFunc mocks the GetAll method.
	GetAllFunc func(ctx context.Context) (migration.Sources, error)

	// GetAllNamesFunc mocks the GetAllNames method.
	GetAllNamesFunc func(ctx context.Context) ([]string, error)

	// GetByNameFunc mocks the GetByName method.
	GetByNameFunc func(ctx context.Context, name string) (*migration.Source, error)

	// RenameFunc mocks the Rename method.
	RenameFunc func(ctx context.Context, oldName string, newName string) error

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, name string, source migration.Source) error
	// contains filtered or unexported fields
}

SourceRepoMock is a mock implementation of migration.SourceRepo.

func TestSomethingThatUsesSourceRepo(t *testing.T) {

	// make and configure a mocked migration.SourceRepo
	mockedSourceRepo := &SourceRepoMock{
		CreateFunc: func(ctx context.Context, source migration.Source) (int64, error) {
			panic("mock out the Create method")
		},
		DeleteByNameFunc: func(ctx context.Context, name string) error {
			panic("mock out the DeleteByName method")
		},
		GetAllFunc: func(ctx context.Context) (migration.Sources, error) {
			panic("mock out the GetAll method")
		},
		GetAllNamesFunc: func(ctx context.Context) ([]string, error) {
			panic("mock out the GetAllNames method")
		},
		GetByNameFunc: func(ctx context.Context, name string) (*migration.Source, error) {
			panic("mock out the GetByName method")
		},
		RenameFunc: func(ctx context.Context, oldName string, newName string) error {
			panic("mock out the Rename method")
		},
		UpdateFunc: func(ctx context.Context, name string, source migration.Source) error {
			panic("mock out the Update method")
		},
	}

	// use mockedSourceRepo in code that requires migration.SourceRepo
	// and then make assertions.

}

func (*SourceRepoMock) Create

func (mock *SourceRepoMock) Create(ctx context.Context, source migration.Source) (int64, error)

Create calls CreateFunc.

func (*SourceRepoMock) CreateCalls

func (mock *SourceRepoMock) CreateCalls() []struct {
	Ctx    context.Context
	Source migration.Source
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedSourceRepo.CreateCalls())

func (*SourceRepoMock) DeleteByName

func (mock *SourceRepoMock) DeleteByName(ctx context.Context, name string) error

DeleteByName calls DeleteByNameFunc.

func (*SourceRepoMock) DeleteByNameCalls

func (mock *SourceRepoMock) DeleteByNameCalls() []struct {
	Ctx  context.Context
	Name string
}

DeleteByNameCalls gets all the calls that were made to DeleteByName. Check the length with:

len(mockedSourceRepo.DeleteByNameCalls())

func (*SourceRepoMock) GetAll

func (mock *SourceRepoMock) GetAll(ctx context.Context) (migration.Sources, error)

GetAll calls GetAllFunc.

func (*SourceRepoMock) GetAllCalls

func (mock *SourceRepoMock) GetAllCalls() []struct {
	Ctx context.Context
}

GetAllCalls gets all the calls that were made to GetAll. Check the length with:

len(mockedSourceRepo.GetAllCalls())

func (*SourceRepoMock) GetAllNames

func (mock *SourceRepoMock) GetAllNames(ctx context.Context) ([]string, error)

GetAllNames calls GetAllNamesFunc.

func (*SourceRepoMock) GetAllNamesCalls

func (mock *SourceRepoMock) GetAllNamesCalls() []struct {
	Ctx context.Context
}

GetAllNamesCalls gets all the calls that were made to GetAllNames. Check the length with:

len(mockedSourceRepo.GetAllNamesCalls())

func (*SourceRepoMock) GetByName

func (mock *SourceRepoMock) GetByName(ctx context.Context, name string) (*migration.Source, error)

GetByName calls GetByNameFunc.

func (*SourceRepoMock) GetByNameCalls

func (mock *SourceRepoMock) GetByNameCalls() []struct {
	Ctx  context.Context
	Name string
}

GetByNameCalls gets all the calls that were made to GetByName. Check the length with:

len(mockedSourceRepo.GetByNameCalls())

func (*SourceRepoMock) Rename

func (mock *SourceRepoMock) Rename(ctx context.Context, oldName string, newName string) error

Rename calls RenameFunc.

func (*SourceRepoMock) RenameCalls

func (mock *SourceRepoMock) RenameCalls() []struct {
	Ctx     context.Context
	OldName string
	NewName string
}

RenameCalls gets all the calls that were made to Rename. Check the length with:

len(mockedSourceRepo.RenameCalls())

func (*SourceRepoMock) Update

func (mock *SourceRepoMock) Update(ctx context.Context, name string, source migration.Source) error

Update calls UpdateFunc.

func (*SourceRepoMock) UpdateCalls

func (mock *SourceRepoMock) UpdateCalls() []struct {
	Ctx    context.Context
	Name   string
	Source migration.Source
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedSourceRepo.UpdateCalls())

type TargetRepoMock

type TargetRepoMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, target migration.Target) (int64, error)

	// DeleteByNameFunc mocks the DeleteByName method.
	DeleteByNameFunc func(ctx context.Context, name string) error

	// GetAllFunc mocks the GetAll method.
	GetAllFunc func(ctx context.Context) (migration.Targets, error)

	// GetAllNamesFunc mocks the GetAllNames method.
	GetAllNamesFunc func(ctx context.Context) ([]string, error)

	// GetByNameFunc mocks the GetByName method.
	GetByNameFunc func(ctx context.Context, name string) (*migration.Target, error)

	// RenameFunc mocks the Rename method.
	RenameFunc func(ctx context.Context, oldName string, newName string) error

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, name string, target migration.Target) error
	// contains filtered or unexported fields
}

TargetRepoMock is a mock implementation of migration.TargetRepo.

func TestSomethingThatUsesTargetRepo(t *testing.T) {

	// make and configure a mocked migration.TargetRepo
	mockedTargetRepo := &TargetRepoMock{
		CreateFunc: func(ctx context.Context, target migration.Target) (int64, error) {
			panic("mock out the Create method")
		},
		DeleteByNameFunc: func(ctx context.Context, name string) error {
			panic("mock out the DeleteByName method")
		},
		GetAllFunc: func(ctx context.Context) (migration.Targets, error) {
			panic("mock out the GetAll method")
		},
		GetAllNamesFunc: func(ctx context.Context) ([]string, error) {
			panic("mock out the GetAllNames method")
		},
		GetByNameFunc: func(ctx context.Context, name string) (*migration.Target, error) {
			panic("mock out the GetByName method")
		},
		RenameFunc: func(ctx context.Context, oldName string, newName string) error {
			panic("mock out the Rename method")
		},
		UpdateFunc: func(ctx context.Context, name string, target migration.Target) error {
			panic("mock out the Update method")
		},
	}

	// use mockedTargetRepo in code that requires migration.TargetRepo
	// and then make assertions.

}

func (*TargetRepoMock) Create

func (mock *TargetRepoMock) Create(ctx context.Context, target migration.Target) (int64, error)

Create calls CreateFunc.

func (*TargetRepoMock) CreateCalls

func (mock *TargetRepoMock) CreateCalls() []struct {
	Ctx    context.Context
	Target migration.Target
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedTargetRepo.CreateCalls())

func (*TargetRepoMock) DeleteByName

func (mock *TargetRepoMock) DeleteByName(ctx context.Context, name string) error

DeleteByName calls DeleteByNameFunc.

func (*TargetRepoMock) DeleteByNameCalls

func (mock *TargetRepoMock) DeleteByNameCalls() []struct {
	Ctx  context.Context
	Name string
}

DeleteByNameCalls gets all the calls that were made to DeleteByName. Check the length with:

len(mockedTargetRepo.DeleteByNameCalls())

func (*TargetRepoMock) GetAll

func (mock *TargetRepoMock) GetAll(ctx context.Context) (migration.Targets, error)

GetAll calls GetAllFunc.

func (*TargetRepoMock) GetAllCalls

func (mock *TargetRepoMock) GetAllCalls() []struct {
	Ctx context.Context
}

GetAllCalls gets all the calls that were made to GetAll. Check the length with:

len(mockedTargetRepo.GetAllCalls())

func (*TargetRepoMock) GetAllNames

func (mock *TargetRepoMock) GetAllNames(ctx context.Context) ([]string, error)

GetAllNames calls GetAllNamesFunc.

func (*TargetRepoMock) GetAllNamesCalls

func (mock *TargetRepoMock) GetAllNamesCalls() []struct {
	Ctx context.Context
}

GetAllNamesCalls gets all the calls that were made to GetAllNames. Check the length with:

len(mockedTargetRepo.GetAllNamesCalls())

func (*TargetRepoMock) GetByName

func (mock *TargetRepoMock) GetByName(ctx context.Context, name string) (*migration.Target, error)

GetByName calls GetByNameFunc.

func (*TargetRepoMock) GetByNameCalls

func (mock *TargetRepoMock) GetByNameCalls() []struct {
	Ctx  context.Context
	Name string
}

GetByNameCalls gets all the calls that were made to GetByName. Check the length with:

len(mockedTargetRepo.GetByNameCalls())

func (*TargetRepoMock) Rename

func (mock *TargetRepoMock) Rename(ctx context.Context, oldName string, newName string) error

Rename calls RenameFunc.

func (*TargetRepoMock) RenameCalls

func (mock *TargetRepoMock) RenameCalls() []struct {
	Ctx     context.Context
	OldName string
	NewName string
}

RenameCalls gets all the calls that were made to Rename. Check the length with:

len(mockedTargetRepo.RenameCalls())

func (*TargetRepoMock) Update

func (mock *TargetRepoMock) Update(ctx context.Context, name string, target migration.Target) error

Update calls UpdateFunc.

func (*TargetRepoMock) UpdateCalls

func (mock *TargetRepoMock) UpdateCalls() []struct {
	Ctx    context.Context
	Name   string
	Target migration.Target
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedTargetRepo.UpdateCalls())

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL