Chore: Split folder store and dashboard store interfaces (#61655)

* update folder store mock

* Split folder store and dashboard store interfaces
This commit is contained in:
Sofia Papagiannaki
2023-01-19 18:38:07 +02:00
committed by GitHub
parent a6102105af
commit c104cc7020
19 changed files with 238 additions and 268 deletions

View File

@@ -25,10 +25,13 @@ func TestDashboardService(t *testing.T) {
fakeStore := dashboards.FakeDashboardStore{}
defer fakeStore.AssertExpectations(t)
folderStore := dashboards.NewFakeFolderStore(t)
service := &DashboardServiceImpl{
cfg: setting.NewCfg(),
log: log.New("test.logger"),
dashboardStore: &fakeStore,
folderStore: folderStore,
dashAlertExtractor: &dummyDashAlertExtractor{},
}
@@ -227,7 +230,7 @@ func TestDashboardService(t *testing.T) {
})
t.Run("Count dashboards in folder", func(t *testing.T) {
fakeStore.On("GetFolderByUID", mock.Anything, mock.AnythingOfType("int64"), mock.AnythingOfType("string")).Return(&folder.Folder{}, nil)
folderStore.On("GetFolderByUID", mock.Anything, mock.AnythingOfType("int64"), mock.AnythingOfType("string")).Return(&folder.Folder{}, nil)
fakeStore.On("CountDashboardsInFolder", mock.Anything, mock.AnythingOfType("*dashboards.CountDashboardsInFolderRequest")).Return(int64(3), nil)
// set up a ctx with signed in user