Change to pointer receiver in mock call (#47575)

pull/47648/head
Shirley 3 years ago committed by GitHub
parent 6592ac537a
commit 4b889eb336
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      pkg/tsdb/cloudwatch/metric_find_query_test.go
  2. 2
      pkg/tsdb/cloudwatch/time_series_query_test.go
  3. 4
      pkg/tsdb/cloudwatch/utils_test.go

@ -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…
Cancel
Save