Documentation
¶
Index ¶
- type BatchRepoMock
- func (mock *BatchRepoMock) AssignBatch(ctx context.Context, batchName string, instanceUUID uuid.UUID) error
- func (mock *BatchRepoMock) AssignBatchCalls() []struct{ ... }
- func (mock *BatchRepoMock) AssignMigrationWindows(ctx context.Context, batch string, windows migration.MigrationWindows) error
- func (mock *BatchRepoMock) AssignMigrationWindowsCalls() []struct{ ... }
- func (mock *BatchRepoMock) Create(ctx context.Context, batch migration.Batch) (int64, error)
- func (mock *BatchRepoMock) CreateCalls() []struct{ ... }
- func (mock *BatchRepoMock) DeleteByName(ctx context.Context, name string) error
- func (mock *BatchRepoMock) DeleteByNameCalls() []struct{ ... }
- func (mock *BatchRepoMock) GetAll(ctx context.Context) (migration.Batches, error)
- func (mock *BatchRepoMock) GetAllByState(ctx context.Context, status api.BatchStatusType) (migration.Batches, error)
- func (mock *BatchRepoMock) GetAllByStateCalls() []struct{ ... }
- func (mock *BatchRepoMock) GetAllCalls() []struct{ ... }
- func (mock *BatchRepoMock) GetAllNames(ctx context.Context) ([]string, error)
- func (mock *BatchRepoMock) GetAllNamesByState(ctx context.Context, status api.BatchStatusType) ([]string, error)
- func (mock *BatchRepoMock) GetAllNamesByStateCalls() []struct{ ... }
- func (mock *BatchRepoMock) GetAllNamesCalls() []struct{ ... }
- func (mock *BatchRepoMock) GetByName(ctx context.Context, name string) (*migration.Batch, error)
- func (mock *BatchRepoMock) GetByNameCalls() []struct{ ... }
- func (mock *BatchRepoMock) GetMigrationWindowsByBatch(ctx context.Context, batch string) (migration.MigrationWindows, error)
- func (mock *BatchRepoMock) GetMigrationWindowsByBatchCalls() []struct{ ... }
- func (mock *BatchRepoMock) Rename(ctx context.Context, oldName string, newName string) error
- func (mock *BatchRepoMock) RenameCalls() []struct{ ... }
- func (mock *BatchRepoMock) UnassignBatch(ctx context.Context, batchName string, instanceUUID uuid.UUID) error
- func (mock *BatchRepoMock) UnassignBatchCalls() []struct{ ... }
- func (mock *BatchRepoMock) UnassignMigrationWindows(ctx context.Context, batch string) error
- func (mock *BatchRepoMock) UnassignMigrationWindowsCalls() []struct{ ... }
- func (mock *BatchRepoMock) Update(ctx context.Context, name string, batch migration.Batch) error
- func (mock *BatchRepoMock) UpdateCalls() []struct{ ... }
- type InstanceRepoMock
- func (mock *InstanceRepoMock) Create(ctx context.Context, instance migration.Instance) (int64, error)
- func (mock *InstanceRepoMock) CreateCalls() []struct{ ... }
- func (mock *InstanceRepoMock) DeleteByUUID(ctx context.Context, id uuid.UUID) error
- func (mock *InstanceRepoMock) DeleteByUUIDCalls() []struct{ ... }
- func (mock *InstanceRepoMock) GetAll(ctx context.Context) (migration.Instances, error)
- func (mock *InstanceRepoMock) GetAllAssigned(ctx context.Context) (migration.Instances, error)
- func (mock *InstanceRepoMock) GetAllAssignedCalls() []struct{ ... }
- func (mock *InstanceRepoMock) GetAllByBatch(ctx context.Context, batch string) (migration.Instances, error)
- func (mock *InstanceRepoMock) GetAllByBatchCalls() []struct{ ... }
- func (mock *InstanceRepoMock) GetAllBySource(ctx context.Context, source string) (migration.Instances, error)
- func (mock *InstanceRepoMock) GetAllBySourceCalls() []struct{ ... }
- func (mock *InstanceRepoMock) GetAllByUUIDs(ctx context.Context, id ...uuid.UUID) (migration.Instances, error)
- func (mock *InstanceRepoMock) GetAllByUUIDsCalls() []struct{ ... }
- func (mock *InstanceRepoMock) GetAllCalls() []struct{ ... }
- func (mock *InstanceRepoMock) GetAllUUIDs(ctx context.Context) ([]uuid.UUID, error)
- func (mock *InstanceRepoMock) GetAllUUIDsBySource(ctx context.Context, source string) ([]uuid.UUID, error)
- func (mock *InstanceRepoMock) GetAllUUIDsBySourceCalls() []struct{ ... }
- func (mock *InstanceRepoMock) GetAllUUIDsCalls() []struct{ ... }
- func (mock *InstanceRepoMock) GetAllUnassigned(ctx context.Context) (migration.Instances, error)
- func (mock *InstanceRepoMock) GetAllUnassignedCalls() []struct{ ... }
- func (mock *InstanceRepoMock) GetBatchesByUUID(ctx context.Context, instanceUUID uuid.UUID) (migration.Batches, error)
- func (mock *InstanceRepoMock) GetBatchesByUUIDCalls() []struct{ ... }
- func (mock *InstanceRepoMock) GetByUUID(ctx context.Context, id uuid.UUID) (*migration.Instance, error)
- func (mock *InstanceRepoMock) GetByUUIDCalls() []struct{ ... }
- func (mock *InstanceRepoMock) RemoveFromQueue(ctx context.Context, id uuid.UUID) error
- func (mock *InstanceRepoMock) RemoveFromQueueCalls() []struct{ ... }
- func (mock *InstanceRepoMock) Update(ctx context.Context, instance migration.Instance) error
- func (mock *InstanceRepoMock) UpdateCalls() []struct{ ... }
- type NetworkRepoMock
- func (mock *NetworkRepoMock) Create(ctx context.Context, network migration.Network) (int64, error)
- func (mock *NetworkRepoMock) CreateCalls() []struct{ ... }
- func (mock *NetworkRepoMock) DeleteByNameAndSource(ctx context.Context, name string, src string) error
- func (mock *NetworkRepoMock) DeleteByNameAndSourceCalls() []struct{ ... }
- func (mock *NetworkRepoMock) GetAll(ctx context.Context) (migration.Networks, error)
- func (mock *NetworkRepoMock) GetAllBySource(ctx context.Context, src string) (migration.Networks, error)
- func (mock *NetworkRepoMock) GetAllBySourceCalls() []struct{ ... }
- func (mock *NetworkRepoMock) GetAllCalls() []struct{ ... }
- func (mock *NetworkRepoMock) GetByNameAndSource(ctx context.Context, name string, src string) (*migration.Network, error)
- func (mock *NetworkRepoMock) GetByNameAndSourceCalls() []struct{ ... }
- func (mock *NetworkRepoMock) Update(ctx context.Context, network migration.Network) error
- func (mock *NetworkRepoMock) UpdateCalls() []struct{ ... }
- type QueueRepoMock
- func (mock *QueueRepoMock) Create(ctx context.Context, queue migration.QueueEntry) (int64, error)
- func (mock *QueueRepoMock) CreateCalls() []struct{ ... }
- func (mock *QueueRepoMock) DeleteAllByBatch(ctx context.Context, batch string) error
- func (mock *QueueRepoMock) DeleteAllByBatchCalls() []struct{ ... }
- func (mock *QueueRepoMock) DeleteByUUID(ctx context.Context, id uuid.UUID) error
- func (mock *QueueRepoMock) DeleteByUUIDCalls() []struct{ ... }
- func (mock *QueueRepoMock) GetAll(ctx context.Context) (migration.QueueEntries, error)
- func (mock *QueueRepoMock) GetAllByBatch(ctx context.Context, batch string) (migration.QueueEntries, error)
- func (mock *QueueRepoMock) GetAllByBatchAndState(ctx context.Context, batch string, statuses ...api.MigrationStatusType) (migration.QueueEntries, error)
- func (mock *QueueRepoMock) GetAllByBatchAndStateCalls() []struct{ ... }
- func (mock *QueueRepoMock) GetAllByBatchCalls() []struct{ ... }
- func (mock *QueueRepoMock) GetAllByState(ctx context.Context, status ...api.MigrationStatusType) (migration.QueueEntries, error)
- func (mock *QueueRepoMock) GetAllByStateCalls() []struct{ ... }
- func (mock *QueueRepoMock) GetAllCalls() []struct{ ... }
- func (mock *QueueRepoMock) GetAllNeedingImport(ctx context.Context, batch string, needsDiskImport bool) (migration.QueueEntries, error)
- func (mock *QueueRepoMock) GetAllNeedingImportCalls() []struct{ ... }
- func (mock *QueueRepoMock) GetByInstanceUUID(ctx context.Context, id uuid.UUID) (*migration.QueueEntry, error)
- func (mock *QueueRepoMock) GetByInstanceUUIDCalls() []struct{ ... }
- func (mock *QueueRepoMock) Update(ctx context.Context, entry migration.QueueEntry) error
- func (mock *QueueRepoMock) UpdateCalls() []struct{ ... }
- type SourceRepoMock
- func (mock *SourceRepoMock) Create(ctx context.Context, source migration.Source) (int64, error)
- func (mock *SourceRepoMock) CreateCalls() []struct{ ... }
- func (mock *SourceRepoMock) DeleteByName(ctx context.Context, name string) error
- func (mock *SourceRepoMock) DeleteByNameCalls() []struct{ ... }
- func (mock *SourceRepoMock) GetAll(ctx context.Context, sourceTypes ...api.SourceType) (migration.Sources, error)
- func (mock *SourceRepoMock) GetAllCalls() []struct{ ... }
- func (mock *SourceRepoMock) GetAllNames(ctx context.Context, sourceTypes ...api.SourceType) ([]string, error)
- func (mock *SourceRepoMock) GetAllNamesCalls() []struct{ ... }
- func (mock *SourceRepoMock) GetByName(ctx context.Context, name string) (*migration.Source, error)
- func (mock *SourceRepoMock) GetByNameCalls() []struct{ ... }
- func (mock *SourceRepoMock) Rename(ctx context.Context, oldName string, newName string) error
- func (mock *SourceRepoMock) RenameCalls() []struct{ ... }
- func (mock *SourceRepoMock) Update(ctx context.Context, name string, source migration.Source) error
- func (mock *SourceRepoMock) UpdateCalls() []struct{ ... }
- type TargetRepoMock
- func (mock *TargetRepoMock) Create(ctx context.Context, target migration.Target) (int64, error)
- func (mock *TargetRepoMock) CreateCalls() []struct{ ... }
- func (mock *TargetRepoMock) DeleteByName(ctx context.Context, name string) error
- func (mock *TargetRepoMock) DeleteByNameCalls() []struct{ ... }
- func (mock *TargetRepoMock) GetAll(ctx context.Context) (migration.Targets, error)
- func (mock *TargetRepoMock) GetAllCalls() []struct{ ... }
- func (mock *TargetRepoMock) GetAllNames(ctx context.Context) ([]string, error)
- func (mock *TargetRepoMock) GetAllNamesCalls() []struct{ ... }
- func (mock *TargetRepoMock) GetByName(ctx context.Context, name string) (*migration.Target, error)
- func (mock *TargetRepoMock) GetByNameCalls() []struct{ ... }
- func (mock *TargetRepoMock) Rename(ctx context.Context, oldName string, newName string) error
- func (mock *TargetRepoMock) RenameCalls() []struct{ ... }
- func (mock *TargetRepoMock) Update(ctx context.Context, name string, target migration.Target) error
- func (mock *TargetRepoMock) UpdateCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchRepoMock ¶
type BatchRepoMock struct { // AssignBatchFunc mocks the AssignBatch method. AssignBatchFunc func(ctx context.Context, batchName string, instanceUUID uuid.UUID) error // AssignMigrationWindowsFunc mocks the AssignMigrationWindows method. AssignMigrationWindowsFunc func(ctx context.Context, batch string, windows migration.MigrationWindows) error // 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) // GetMigrationWindowsByBatchFunc mocks the GetMigrationWindowsByBatch method. GetMigrationWindowsByBatchFunc func(ctx context.Context, batch string) (migration.MigrationWindows, error) // RenameFunc mocks the Rename method. RenameFunc func(ctx context.Context, oldName string, newName string) error // UnassignBatchFunc mocks the UnassignBatch method. UnassignBatchFunc func(ctx context.Context, batchName string, instanceUUID uuid.UUID) error // UnassignMigrationWindowsFunc mocks the UnassignMigrationWindows method. UnassignMigrationWindowsFunc func(ctx context.Context, batch 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{ AssignBatchFunc: func(ctx context.Context, batchName string, instanceUUID uuid.UUID) error { panic("mock out the AssignBatch method") }, AssignMigrationWindowsFunc: func(ctx context.Context, batch string, windows migration.MigrationWindows) error { panic("mock out the AssignMigrationWindows method") }, 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") }, GetMigrationWindowsByBatchFunc: func(ctx context.Context, batch string) (migration.MigrationWindows, error) { panic("mock out the GetMigrationWindowsByBatch method") }, RenameFunc: func(ctx context.Context, oldName string, newName string) error { panic("mock out the Rename method") }, UnassignBatchFunc: func(ctx context.Context, batchName string, instanceUUID uuid.UUID) error { panic("mock out the UnassignBatch method") }, UnassignMigrationWindowsFunc: func(ctx context.Context, batch string) error { panic("mock out the UnassignMigrationWindows 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) AssignBatch ¶
func (mock *BatchRepoMock) AssignBatch(ctx context.Context, batchName string, instanceUUID uuid.UUID) error
AssignBatch calls AssignBatchFunc.
func (*BatchRepoMock) AssignBatchCalls ¶
func (mock *BatchRepoMock) AssignBatchCalls() []struct { Ctx context.Context BatchName string InstanceUUID uuid.UUID }
AssignBatchCalls gets all the calls that were made to AssignBatch. Check the length with:
len(mockedBatchRepo.AssignBatchCalls())
func (*BatchRepoMock) AssignMigrationWindows ¶
func (mock *BatchRepoMock) AssignMigrationWindows(ctx context.Context, batch string, windows migration.MigrationWindows) error
AssignMigrationWindows calls AssignMigrationWindowsFunc.
func (*BatchRepoMock) AssignMigrationWindowsCalls ¶
func (mock *BatchRepoMock) AssignMigrationWindowsCalls() []struct { Ctx context.Context Batch string Windows migration.MigrationWindows }
AssignMigrationWindowsCalls gets all the calls that were made to AssignMigrationWindows. Check the length with:
len(mockedBatchRepo.AssignMigrationWindowsCalls())
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) 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) 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) GetMigrationWindowsByBatch ¶
func (mock *BatchRepoMock) GetMigrationWindowsByBatch(ctx context.Context, batch string) (migration.MigrationWindows, error)
GetMigrationWindowsByBatch calls GetMigrationWindowsByBatchFunc.
func (*BatchRepoMock) GetMigrationWindowsByBatchCalls ¶
func (mock *BatchRepoMock) GetMigrationWindowsByBatchCalls() []struct { Ctx context.Context Batch string }
GetMigrationWindowsByBatchCalls gets all the calls that were made to GetMigrationWindowsByBatch. Check the length with:
len(mockedBatchRepo.GetMigrationWindowsByBatchCalls())
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) UnassignBatch ¶
func (mock *BatchRepoMock) UnassignBatch(ctx context.Context, batchName string, instanceUUID uuid.UUID) error
UnassignBatch calls UnassignBatchFunc.
func (*BatchRepoMock) UnassignBatchCalls ¶
func (mock *BatchRepoMock) UnassignBatchCalls() []struct { Ctx context.Context BatchName string InstanceUUID uuid.UUID }
UnassignBatchCalls gets all the calls that were made to UnassignBatch. Check the length with:
len(mockedBatchRepo.UnassignBatchCalls())
func (*BatchRepoMock) UnassignMigrationWindows ¶
func (mock *BatchRepoMock) UnassignMigrationWindows(ctx context.Context, batch string) error
UnassignMigrationWindows calls UnassignMigrationWindowsFunc.
func (*BatchRepoMock) UnassignMigrationWindowsCalls ¶
func (mock *BatchRepoMock) UnassignMigrationWindowsCalls() []struct { Ctx context.Context Batch string }
UnassignMigrationWindowsCalls gets all the calls that were made to UnassignMigrationWindows. Check the length with:
len(mockedBatchRepo.UnassignMigrationWindowsCalls())
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) // DeleteByUUIDFunc mocks the DeleteByUUID method. DeleteByUUIDFunc func(ctx context.Context, id uuid.UUID) error // GetAllFunc mocks the GetAll method. GetAllFunc func(ctx context.Context) (migration.Instances, error) // GetAllAssignedFunc mocks the GetAllAssigned method. GetAllAssignedFunc func(ctx context.Context) (migration.Instances, error) // GetAllByBatchFunc mocks the GetAllByBatch method. GetAllByBatchFunc func(ctx context.Context, batch string) (migration.Instances, error) // GetAllBySourceFunc mocks the GetAllBySource method. GetAllBySourceFunc func(ctx context.Context, source string) (migration.Instances, error) // GetAllByUUIDsFunc mocks the GetAllByUUIDs method. GetAllByUUIDsFunc func(ctx context.Context, id ...uuid.UUID) (migration.Instances, error) // GetAllUUIDsFunc mocks the GetAllUUIDs method. GetAllUUIDsFunc func(ctx context.Context) ([]uuid.UUID, error) // GetAllUUIDsBySourceFunc mocks the GetAllUUIDsBySource method. GetAllUUIDsBySourceFunc func(ctx context.Context, source string) ([]uuid.UUID, error) // GetAllUnassignedFunc mocks the GetAllUnassigned method. GetAllUnassignedFunc func(ctx context.Context) (migration.Instances, error) // GetBatchesByUUIDFunc mocks the GetBatchesByUUID method. GetBatchesByUUIDFunc func(ctx context.Context, instanceUUID uuid.UUID) (migration.Batches, error) // GetByUUIDFunc mocks the GetByUUID method. GetByUUIDFunc func(ctx context.Context, id uuid.UUID) (*migration.Instance, error) // RemoveFromQueueFunc mocks the RemoveFromQueue method. RemoveFromQueueFunc func(ctx context.Context, id uuid.UUID) error // UpdateFunc mocks the Update method. UpdateFunc func(ctx context.Context, instance migration.Instance) 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") }, DeleteByUUIDFunc: func(ctx context.Context, id uuid.UUID) error { panic("mock out the DeleteByUUID method") }, GetAllFunc: func(ctx context.Context) (migration.Instances, error) { panic("mock out the GetAll method") }, GetAllAssignedFunc: func(ctx context.Context) (migration.Instances, error) { panic("mock out the GetAllAssigned method") }, GetAllByBatchFunc: func(ctx context.Context, batch string) (migration.Instances, error) { panic("mock out the GetAllByBatch method") }, GetAllBySourceFunc: func(ctx context.Context, source string) (migration.Instances, error) { panic("mock out the GetAllBySource method") }, GetAllByUUIDsFunc: func(ctx context.Context, id ...uuid.UUID) (migration.Instances, error) { panic("mock out the GetAllByUUIDs method") }, GetAllUUIDsFunc: func(ctx context.Context) ([]uuid.UUID, error) { panic("mock out the GetAllUUIDs method") }, GetAllUUIDsBySourceFunc: func(ctx context.Context, source string) ([]uuid.UUID, error) { panic("mock out the GetAllUUIDsBySource method") }, GetAllUnassignedFunc: func(ctx context.Context) (migration.Instances, error) { panic("mock out the GetAllUnassigned method") }, GetBatchesByUUIDFunc: func(ctx context.Context, instanceUUID uuid.UUID) (migration.Batches, error) { panic("mock out the GetBatchesByUUID method") }, GetByUUIDFunc: func(ctx context.Context, id uuid.UUID) (*migration.Instance, error) { panic("mock out the GetByUUID method") }, RemoveFromQueueFunc: func(ctx context.Context, id uuid.UUID) error { panic("mock out the RemoveFromQueue method") }, UpdateFunc: func(ctx context.Context, instance migration.Instance) error { panic("mock out the Update 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) DeleteByUUID ¶
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) GetAllAssigned ¶
GetAllAssigned calls GetAllAssignedFunc.
func (*InstanceRepoMock) GetAllAssignedCalls ¶
func (mock *InstanceRepoMock) GetAllAssignedCalls() []struct { Ctx context.Context }
GetAllAssignedCalls gets all the calls that were made to GetAllAssigned. Check the length with:
len(mockedInstanceRepo.GetAllAssignedCalls())
func (*InstanceRepoMock) GetAllByBatch ¶
func (mock *InstanceRepoMock) GetAllByBatch(ctx context.Context, batch string) (migration.Instances, error)
GetAllByBatch calls GetAllByBatchFunc.
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) GetAllByUUIDs ¶
func (mock *InstanceRepoMock) GetAllByUUIDs(ctx context.Context, id ...uuid.UUID) (migration.Instances, error)
GetAllByUUIDs calls GetAllByUUIDsFunc.
func (*InstanceRepoMock) GetAllByUUIDsCalls ¶
func (mock *InstanceRepoMock) GetAllByUUIDsCalls() []struct { Ctx context.Context ID []uuid.UUID }
GetAllByUUIDsCalls gets all the calls that were made to GetAllByUUIDs. Check the length with:
len(mockedInstanceRepo.GetAllByUUIDsCalls())
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 ¶
GetAllUUIDs calls GetAllUUIDsFunc.
func (*InstanceRepoMock) GetAllUUIDsBySource ¶
func (mock *InstanceRepoMock) GetAllUUIDsBySource(ctx context.Context, source string) ([]uuid.UUID, error)
GetAllUUIDsBySource calls GetAllUUIDsBySourceFunc.
func (*InstanceRepoMock) GetAllUUIDsBySourceCalls ¶
func (mock *InstanceRepoMock) GetAllUUIDsBySourceCalls() []struct { Ctx context.Context Source string }
GetAllUUIDsBySourceCalls gets all the calls that were made to GetAllUUIDsBySource. Check the length with:
len(mockedInstanceRepo.GetAllUUIDsBySourceCalls())
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 ¶
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) GetBatchesByUUID ¶
func (mock *InstanceRepoMock) GetBatchesByUUID(ctx context.Context, instanceUUID uuid.UUID) (migration.Batches, error)
GetBatchesByUUID calls GetBatchesByUUIDFunc.
func (*InstanceRepoMock) GetBatchesByUUIDCalls ¶
func (mock *InstanceRepoMock) GetBatchesByUUIDCalls() []struct { Ctx context.Context InstanceUUID uuid.UUID }
GetBatchesByUUIDCalls gets all the calls that were made to GetBatchesByUUID. Check the length with:
len(mockedInstanceRepo.GetBatchesByUUIDCalls())
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) RemoveFromQueue ¶
RemoveFromQueue calls RemoveFromQueueFunc.
func (*InstanceRepoMock) RemoveFromQueueCalls ¶
func (mock *InstanceRepoMock) RemoveFromQueueCalls() []struct { Ctx context.Context ID uuid.UUID }
RemoveFromQueueCalls gets all the calls that were made to RemoveFromQueue. Check the length with:
len(mockedInstanceRepo.RemoveFromQueueCalls())
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())
type NetworkRepoMock ¶
type NetworkRepoMock struct { // CreateFunc mocks the Create method. CreateFunc func(ctx context.Context, network migration.Network) (int64, error) // DeleteByNameAndSourceFunc mocks the DeleteByNameAndSource method. DeleteByNameAndSourceFunc func(ctx context.Context, name string, src string) error // GetAllFunc mocks the GetAll method. GetAllFunc func(ctx context.Context) (migration.Networks, error) // GetAllBySourceFunc mocks the GetAllBySource method. GetAllBySourceFunc func(ctx context.Context, src string) (migration.Networks, error) // GetByNameAndSourceFunc mocks the GetByNameAndSource method. GetByNameAndSourceFunc func(ctx context.Context, name string, src string) (*migration.Network, 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") }, DeleteByNameAndSourceFunc: func(ctx context.Context, name string, src string) error { panic("mock out the DeleteByNameAndSource method") }, GetAllFunc: func(ctx context.Context) (migration.Networks, error) { panic("mock out the GetAll method") }, GetAllBySourceFunc: func(ctx context.Context, src string) (migration.Networks, error) { panic("mock out the GetAllBySource method") }, GetByNameAndSourceFunc: func(ctx context.Context, name string, src string) (*migration.Network, error) { panic("mock out the GetByNameAndSource 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) 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) DeleteByNameAndSource ¶
func (mock *NetworkRepoMock) DeleteByNameAndSource(ctx context.Context, name string, src string) error
DeleteByNameAndSource calls DeleteByNameAndSourceFunc.
func (*NetworkRepoMock) DeleteByNameAndSourceCalls ¶
func (mock *NetworkRepoMock) DeleteByNameAndSourceCalls() []struct { Ctx context.Context Name string Src string }
DeleteByNameAndSourceCalls gets all the calls that were made to DeleteByNameAndSource. Check the length with:
len(mockedNetworkRepo.DeleteByNameAndSourceCalls())
func (*NetworkRepoMock) GetAllBySource ¶
func (mock *NetworkRepoMock) GetAllBySource(ctx context.Context, src string) (migration.Networks, error)
GetAllBySource calls GetAllBySourceFunc.
func (*NetworkRepoMock) GetAllBySourceCalls ¶
func (mock *NetworkRepoMock) GetAllBySourceCalls() []struct { Ctx context.Context Src string }
GetAllBySourceCalls gets all the calls that were made to GetAllBySource. Check the length with:
len(mockedNetworkRepo.GetAllBySourceCalls())
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) GetByNameAndSource ¶
func (mock *NetworkRepoMock) GetByNameAndSource(ctx context.Context, name string, src string) (*migration.Network, error)
GetByNameAndSource calls GetByNameAndSourceFunc.
func (*NetworkRepoMock) GetByNameAndSourceCalls ¶
func (mock *NetworkRepoMock) GetByNameAndSourceCalls() []struct { Ctx context.Context Name string Src string }
GetByNameAndSourceCalls gets all the calls that were made to GetByNameAndSource. Check the length with:
len(mockedNetworkRepo.GetByNameAndSourceCalls())
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 QueueRepoMock ¶
type QueueRepoMock struct { // CreateFunc mocks the Create method. CreateFunc func(ctx context.Context, queue migration.QueueEntry) (int64, error) // DeleteAllByBatchFunc mocks the DeleteAllByBatch method. DeleteAllByBatchFunc func(ctx context.Context, batch string) error // DeleteByUUIDFunc mocks the DeleteByUUID method. DeleteByUUIDFunc func(ctx context.Context, id uuid.UUID) error // GetAllFunc mocks the GetAll method. GetAllFunc func(ctx context.Context) (migration.QueueEntries, error) // GetAllByBatchFunc mocks the GetAllByBatch method. GetAllByBatchFunc func(ctx context.Context, batch string) (migration.QueueEntries, error) // GetAllByBatchAndStateFunc mocks the GetAllByBatchAndState method. GetAllByBatchAndStateFunc func(ctx context.Context, batch string, statuses ...api.MigrationStatusType) (migration.QueueEntries, error) // GetAllByStateFunc mocks the GetAllByState method. GetAllByStateFunc func(ctx context.Context, status ...api.MigrationStatusType) (migration.QueueEntries, error) // GetAllNeedingImportFunc mocks the GetAllNeedingImport method. GetAllNeedingImportFunc func(ctx context.Context, batch string, needsDiskImport bool) (migration.QueueEntries, error) // GetByInstanceUUIDFunc mocks the GetByInstanceUUID method. GetByInstanceUUIDFunc func(ctx context.Context, id uuid.UUID) (*migration.QueueEntry, error) // UpdateFunc mocks the Update method. UpdateFunc func(ctx context.Context, entry migration.QueueEntry) error // contains filtered or unexported fields }
QueueRepoMock is a mock implementation of migration.QueueRepo.
func TestSomethingThatUsesQueueRepo(t *testing.T) { // make and configure a mocked migration.QueueRepo mockedQueueRepo := &QueueRepoMock{ CreateFunc: func(ctx context.Context, queue migration.QueueEntry) (int64, error) { panic("mock out the Create method") }, DeleteAllByBatchFunc: func(ctx context.Context, batch string) error { panic("mock out the DeleteAllByBatch method") }, DeleteByUUIDFunc: func(ctx context.Context, id uuid.UUID) error { panic("mock out the DeleteByUUID method") }, GetAllFunc: func(ctx context.Context) (migration.QueueEntries, error) { panic("mock out the GetAll method") }, GetAllByBatchFunc: func(ctx context.Context, batch string) (migration.QueueEntries, error) { panic("mock out the GetAllByBatch method") }, GetAllByBatchAndStateFunc: func(ctx context.Context, batch string, statuses ...api.MigrationStatusType) (migration.QueueEntries, error) { panic("mock out the GetAllByBatchAndState method") }, GetAllByStateFunc: func(ctx context.Context, status ...api.MigrationStatusType) (migration.QueueEntries, error) { panic("mock out the GetAllByState method") }, GetAllNeedingImportFunc: func(ctx context.Context, batch string, needsDiskImport bool) (migration.QueueEntries, error) { panic("mock out the GetAllNeedingImport method") }, GetByInstanceUUIDFunc: func(ctx context.Context, id uuid.UUID) (*migration.QueueEntry, error) { panic("mock out the GetByInstanceUUID method") }, UpdateFunc: func(ctx context.Context, entry migration.QueueEntry) error { panic("mock out the Update method") }, } // use mockedQueueRepo in code that requires migration.QueueRepo // and then make assertions. }
func (*QueueRepoMock) Create ¶
func (mock *QueueRepoMock) Create(ctx context.Context, queue migration.QueueEntry) (int64, error)
Create calls CreateFunc.
func (*QueueRepoMock) CreateCalls ¶
func (mock *QueueRepoMock) CreateCalls() []struct { Ctx context.Context Queue migration.QueueEntry }
CreateCalls gets all the calls that were made to Create. Check the length with:
len(mockedQueueRepo.CreateCalls())
func (*QueueRepoMock) DeleteAllByBatch ¶
func (mock *QueueRepoMock) DeleteAllByBatch(ctx context.Context, batch string) error
DeleteAllByBatch calls DeleteAllByBatchFunc.
func (*QueueRepoMock) DeleteAllByBatchCalls ¶
func (mock *QueueRepoMock) DeleteAllByBatchCalls() []struct { Ctx context.Context Batch string }
DeleteAllByBatchCalls gets all the calls that were made to DeleteAllByBatch. Check the length with:
len(mockedQueueRepo.DeleteAllByBatchCalls())
func (*QueueRepoMock) DeleteByUUID ¶
DeleteByUUID calls DeleteByUUIDFunc.
func (*QueueRepoMock) DeleteByUUIDCalls ¶
func (mock *QueueRepoMock) DeleteByUUIDCalls() []struct { Ctx context.Context ID uuid.UUID }
DeleteByUUIDCalls gets all the calls that were made to DeleteByUUID. Check the length with:
len(mockedQueueRepo.DeleteByUUIDCalls())
func (*QueueRepoMock) GetAll ¶
func (mock *QueueRepoMock) GetAll(ctx context.Context) (migration.QueueEntries, error)
GetAll calls GetAllFunc.
func (*QueueRepoMock) GetAllByBatch ¶
func (mock *QueueRepoMock) GetAllByBatch(ctx context.Context, batch string) (migration.QueueEntries, error)
GetAllByBatch calls GetAllByBatchFunc.
func (*QueueRepoMock) GetAllByBatchAndState ¶
func (mock *QueueRepoMock) GetAllByBatchAndState(ctx context.Context, batch string, statuses ...api.MigrationStatusType) (migration.QueueEntries, error)
GetAllByBatchAndState calls GetAllByBatchAndStateFunc.
func (*QueueRepoMock) GetAllByBatchAndStateCalls ¶
func (mock *QueueRepoMock) GetAllByBatchAndStateCalls() []struct { Ctx context.Context Batch string Statuses []api.MigrationStatusType }
GetAllByBatchAndStateCalls gets all the calls that were made to GetAllByBatchAndState. Check the length with:
len(mockedQueueRepo.GetAllByBatchAndStateCalls())
func (*QueueRepoMock) GetAllByBatchCalls ¶
func (mock *QueueRepoMock) GetAllByBatchCalls() []struct { Ctx context.Context Batch string }
GetAllByBatchCalls gets all the calls that were made to GetAllByBatch. Check the length with:
len(mockedQueueRepo.GetAllByBatchCalls())
func (*QueueRepoMock) GetAllByState ¶
func (mock *QueueRepoMock) GetAllByState(ctx context.Context, status ...api.MigrationStatusType) (migration.QueueEntries, error)
GetAllByState calls GetAllByStateFunc.
func (*QueueRepoMock) GetAllByStateCalls ¶
func (mock *QueueRepoMock) GetAllByStateCalls() []struct { Ctx context.Context Status []api.MigrationStatusType }
GetAllByStateCalls gets all the calls that were made to GetAllByState. Check the length with:
len(mockedQueueRepo.GetAllByStateCalls())
func (*QueueRepoMock) GetAllCalls ¶
func (mock *QueueRepoMock) GetAllCalls() []struct { Ctx context.Context }
GetAllCalls gets all the calls that were made to GetAll. Check the length with:
len(mockedQueueRepo.GetAllCalls())
func (*QueueRepoMock) GetAllNeedingImport ¶
func (mock *QueueRepoMock) GetAllNeedingImport(ctx context.Context, batch string, needsDiskImport bool) (migration.QueueEntries, error)
GetAllNeedingImport calls GetAllNeedingImportFunc.
func (*QueueRepoMock) GetAllNeedingImportCalls ¶
func (mock *QueueRepoMock) GetAllNeedingImportCalls() []struct { Ctx context.Context Batch string NeedsDiskImport bool }
GetAllNeedingImportCalls gets all the calls that were made to GetAllNeedingImport. Check the length with:
len(mockedQueueRepo.GetAllNeedingImportCalls())
func (*QueueRepoMock) GetByInstanceUUID ¶
func (mock *QueueRepoMock) GetByInstanceUUID(ctx context.Context, id uuid.UUID) (*migration.QueueEntry, error)
GetByInstanceUUID calls GetByInstanceUUIDFunc.
func (*QueueRepoMock) GetByInstanceUUIDCalls ¶
func (mock *QueueRepoMock) GetByInstanceUUIDCalls() []struct { Ctx context.Context ID uuid.UUID }
GetByInstanceUUIDCalls gets all the calls that were made to GetByInstanceUUID. Check the length with:
len(mockedQueueRepo.GetByInstanceUUIDCalls())
func (*QueueRepoMock) Update ¶
func (mock *QueueRepoMock) Update(ctx context.Context, entry migration.QueueEntry) error
Update calls UpdateFunc.
func (*QueueRepoMock) UpdateCalls ¶
func (mock *QueueRepoMock) UpdateCalls() []struct { Ctx context.Context Entry migration.QueueEntry }
UpdateCalls gets all the calls that were made to Update. Check the length with:
len(mockedQueueRepo.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, sourceTypes ...api.SourceType) (migration.Sources, error) // GetAllNamesFunc mocks the GetAllNames method. GetAllNamesFunc func(ctx context.Context, sourceTypes ...api.SourceType) ([]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, sourceTypes ...api.SourceType) (migration.Sources, error) { panic("mock out the GetAll method") }, GetAllNamesFunc: func(ctx context.Context, sourceTypes ...api.SourceType) ([]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) 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, sourceTypes ...api.SourceType) (migration.Sources, error)
GetAll calls GetAllFunc.
func (*SourceRepoMock) GetAllCalls ¶
func (mock *SourceRepoMock) GetAllCalls() []struct { Ctx context.Context SourceTypes []api.SourceType }
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, sourceTypes ...api.SourceType) ([]string, error)
GetAllNames calls GetAllNamesFunc.
func (*SourceRepoMock) GetAllNamesCalls ¶
func (mock *SourceRepoMock) GetAllNamesCalls() []struct { Ctx context.Context SourceTypes []api.SourceType }
GetAllNamesCalls gets all the calls that were made to GetAllNames. Check the length with:
len(mockedSourceRepo.GetAllNamesCalls())
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) 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) 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) 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) 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) 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) 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) 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())