Skip to content

Commit

Permalink
Add mock client comments
Browse files Browse the repository at this point in the history
Signed-off-by: Orlando Valdez <[email protected]>
  • Loading branch information
orlando-valdez-ck committed Aug 1, 2024
1 parent 33cbf3f commit b50ee70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions metricproviders/newrelic/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b50ee70

Please sign in to comment.