mock_storage_test.go | |
---|---|
|
|
Mock storage implementation that is used in unit tests. Documentation in literate-programming-style is available at: https://redhatinsights.github.io/ccx-notification-writer/packages/mockstoragetest.html |
|
MockStorage structure represents a mocked implementation of Storage interface to be used by tested consumer |
|
NewMockStorage constructs new mock storage instance |
|
Close is a mocked reimplementation of the real Close method. |
|
return no error |
|
WriteReportForCluster is a mocked reimplementation of the real WriteReportForCluster method. |
|
return no error |
|
DatabaseInitialization is a mocked reimplementation of the real DatabaseInitialization method. |
|
return no error |
|
DatabaseInitMigration is a mocked reimplementation of the real DatabaseInitMigration method. |
|
return no error |
|
DatabaseCleanup is a mocked reimplementation of the real DatabaseCleanup method. |
|
return no error |
|
DatabaseDropTables is a mocked reimplementation of the real DatabaseDropTables method. |
|
return no error |
|
DatabaseDropIndexes is a mocked reimplementation of the real DatabaseDropIndexes method. |
|
return no error |
|
GetLatestKafkaOffset is a mocked reimplementation of the real GetLatestKafkaOffset method. |
|
return some offset + no error |
|
PrintNewReportsForCleanup is a mocked reimplementation of the real PrintNewReportsForCleanup method. |
|
return no error |
|
CleanupNewReports is a mocked reimplementation of the real CleanupNewReports method. |
|
return number of cleaned records + no error |
|
PrintOldReportsForCleanup is a mocked reimplementation of the real PrintOldReportsForCleanup method. |
|
return no error |
|
CleanupOldReports is a mocked reimplementation of the real CleanupOldReports method. |
|
return number of cleaned records + no error |
|
PrintReadErrorsForCleanup is a mocked reimplementation of the real PrintReadErrorsForCleanup method. |
|
return no error |
|
CleanupReadErrors is a mocked reimplementation of the real CleanupReadErrors method. |
|
return number of cleaned records + no error |
|