testhelpers

package
v0.30.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminAPIKey    = "adminAPIKey"                                     // AdminAPIKey used in mock configs (from Environment for Integration tests)
	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
)
View Source
const (
	// DTK Terraform Test Account
	TestAccountID = 2520528
)

Variables

This section is empty.

Functions

func NewIntegrationTestConfig

func NewIntegrationTestConfig(t *testing.T) config.Config

NewIntegrationTestConfig grabs environment vars for required fields or skips the test. returns a fully saturated configuration

func NewMockServer

func NewMockServer(t *testing.T, mockJSONResponse string, statusCode int) *httptest.Server

NewMockServer creates a server to respond to API calls for unit tests

func NewTestConfig

func NewTestConfig(t *testing.T, testServer *httptest.Server) config.Config

NewTestConfig returns a fully saturated configration with modified BaseURLs for all endpoints based on the test server passed in

func RandSeq

func RandSeq(n int) string

RandSeq is used to get a string made up of n random lowercase letters.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL