mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Change to pointer receiver in mock call (#47575)
This commit is contained in:
parent
6592ac537a
commit
4b889eb336
@ -32,7 +32,7 @@ func TestQuery_Metrics(t *testing.T) {
|
||||
var cwClient fakeCWClient
|
||||
|
||||
NewCWClient = func(sess *session.Session) cloudwatchiface.CloudWatchAPI {
|
||||
return cwClient
|
||||
return &cwClient
|
||||
}
|
||||
|
||||
t.Run("Custom metrics", func(t *testing.T) {
|
||||
@ -403,7 +403,7 @@ func TestQuery_GetDimensionKeys(t *testing.T) {
|
||||
var client fakeCWClient
|
||||
|
||||
NewCWClient = func(sess *session.Session) cloudwatchiface.CloudWatchAPI {
|
||||
return client
|
||||
return &client
|
||||
}
|
||||
|
||||
metrics := []*cloudwatch.Metric{
|
||||
@ -527,7 +527,7 @@ func TestQuery_ListMetricsPagination(t *testing.T) {
|
||||
var client fakeCWClient
|
||||
|
||||
NewCWClient = func(sess *session.Session) cloudwatchiface.CloudWatchAPI {
|
||||
return client
|
||||
return &client
|
||||
}
|
||||
|
||||
metrics := []*cloudwatch.Metric{
|
||||
|
@ -30,7 +30,7 @@ func TestTimeSeriesQuery(t *testing.T) {
|
||||
var cwClient fakeCWClient
|
||||
|
||||
NewCWClient = func(sess *session.Session) cloudwatchiface.CloudWatchAPI {
|
||||
return cwClient
|
||||
return &cwClient
|
||||
}
|
||||
|
||||
t.Run("Custom metrics", func(t *testing.T) {
|
||||
|
@ -67,11 +67,11 @@ type fakeCWClient struct {
|
||||
MetricsPerPage int
|
||||
}
|
||||
|
||||
func (c fakeCWClient) GetMetricDataWithContext(aws.Context, *cloudwatch.GetMetricDataInput, ...request.Option) (*cloudwatch.GetMetricDataOutput, error) {
|
||||
func (c *fakeCWClient) GetMetricDataWithContext(aws.Context, *cloudwatch.GetMetricDataInput, ...request.Option) (*cloudwatch.GetMetricDataOutput, error) {
|
||||
return &c.GetMetricDataOutput, nil
|
||||
}
|
||||
|
||||
func (c fakeCWClient) ListMetricsPages(input *cloudwatch.ListMetricsInput, fn func(*cloudwatch.ListMetricsOutput, bool) bool) error {
|
||||
func (c *fakeCWClient) ListMetricsPages(input *cloudwatch.ListMetricsInput, fn func(*cloudwatch.ListMetricsOutput, bool) bool) error {
|
||||
if c.MetricsPerPage == 0 {
|
||||
c.MetricsPerPage = 1000
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user