[v9.3.x] CloudWatch: fix custom namespace for listing dimension keys, refactor to non-pointer types, add test assertions, rename packages (#59130)

CloudWatch: fix custom namespace for listing dimension keys, refactor to non-pointer types, add test assertions, rename packages (#59106)

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
(cherry picked from commit c43e1a721f)

Co-authored-by: Shirley <4163034+fridgepoet@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-11-22 16:25:27 +01:00
committed by GitHub
co-authored by Shirley
parent 3a1ffd88d5
commit f3ffc1a495
32 changed files with 194 additions and 160 deletions
@@ -1,8 +1,7 @@
package mocks
import (
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/models"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/models/request"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/models/resources"
"github.com/stretchr/testify/mock"
)
@@ -10,26 +9,26 @@ type ListMetricsServiceMock struct {
mock.Mock
}
func (a *ListMetricsServiceMock) GetDimensionKeysByDimensionFilter(*request.DimensionKeysRequest) ([]string, error) {
args := a.Called()
func (a *ListMetricsServiceMock) GetDimensionKeysByDimensionFilter(r resources.DimensionKeysRequest) ([]string, error) {
args := a.Called(r)
return args.Get(0).([]string), args.Error(1)
}
func (a *ListMetricsServiceMock) GetDimensionValuesByDimensionFilter(r *request.DimensionValuesRequest) ([]string, error) {
args := a.Called()
func (a *ListMetricsServiceMock) GetDimensionValuesByDimensionFilter(r resources.DimensionValuesRequest) ([]string, error) {
args := a.Called(r)
return args.Get(0).([]string), args.Error(1)
}
func (a *ListMetricsServiceMock) GetDimensionKeysByNamespace(string) ([]string, error) {
args := a.Called()
func (a *ListMetricsServiceMock) GetDimensionKeysByNamespace(namespace string) ([]string, error) {
args := a.Called(namespace)
return args.Get(0).([]string), args.Error(1)
}
func (a *ListMetricsServiceMock) GetMetricsByNamespace(namespace string) ([]models.Metric, error) {
args := a.Called()
func (a *ListMetricsServiceMock) GetMetricsByNamespace(namespace string) ([]resources.Metric, error) {
args := a.Called(namespace)
return args.Get(0).([]models.Metric), args.Error(1)
return args.Get(0).([]resources.Metric), args.Error(1)
}