From b50ee700ae6708c2fee8d1b86aa5a8e4436a5ae9 Mon Sep 17 00:00:00 2001 From: Orlando Valdez Date: Thu, 1 Aug 2024 11:02:14 -0400 Subject: [PATCH] Add mock client comments Signed-off-by: Orlando Valdez --- metricproviders/newrelic/mock_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/metricproviders/newrelic/mock_test.go b/metricproviders/newrelic/mock_test.go index a584d09e2a..a9386b12fa 100644 --- a/metricproviders/newrelic/mock_test.go +++ b/metricproviders/newrelic/mock_test.go @@ -43,18 +43,22 @@ func (m *mockNerdGraphClient) QueryWithResponse(query string, variables map[stri return nil } +// Response sets the response the mock client will return func (m *mockNerdGraphClient) Response(response []nrdb.NRDBResult) { m.response = response } +// LastArgs returns the variables used when calling the NerdGraph API func (m *mockNerdGraphClient) LastArgs() map[string]any { return m.lastArgs } +// Err sets the error to be returned when calling the NerdGraph API func (m *mockNerdGraphClient) Err(err error) { m.err = err } +// Clear removes all configured mock behavior func (m *mockNerdGraphClient) Clear() { m.err = nil m.response = nil