Documentation ¶
Index ¶
- Constants
- func GetTestAccountID() (int, error)
- func GetTestUserID() (int, error)
- func NewIntegrationTestConfig(t *testing.T) config.Config
- func NewMockServer(t *testing.T, mockJSONResponse string, statusCode int) *httptest.Server
- func NewTestConfig(t *testing.T, testServer *httptest.Server) config.Config
- func RandSeq(n int) string
Constants ¶
View Source
const ( HTTPTimeout = 60 * time.Second // HTTPTimeout increases the timeout for integration tests LicenseKey = "APMLicenseKey" // LicenseKey used in mock configs LogLevel = "debug" // LogLevel used in mock configs PersonalAPIKey = "personalAPIKey" // PersonalAPIKey used in mock configs (from Environment for Integration tests) UserAgent = "newrelic/newrelic-client-go (automated testing)" // UserAgent used in mock configs )
Variables ¶
This section is empty.
Functions ¶
func GetTestAccountID ¶ added in v0.56.1
GetTestAccountID returns the integer value for a New Relic Account ID from the environment
func GetTestUserID ¶ added in v0.37.0
GetTestUserID returns the integer value for a New Relic user ID from the environment
func NewIntegrationTestConfig ¶
NewIntegrationTestConfig grabs environment vars for required fields or skips the test. returns a fully saturated configuration
func NewMockServer ¶
NewMockServer creates a server to respond to API calls for unit tests
func NewTestConfig ¶
NewTestConfig returns a fully saturated configration with modified BaseURLs for all endpoints based on the test server passed in
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.