testutils

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestToken    = "TEST_ACCESS_TOKEN"
	TestUsername = "user@example.com"
	TestPassword = "password123"
	TestTenantID = "00000000-0000-0000-0000-000000000000"
	TestClientID = "80faf920-1908-4b52-b5ef-a8e7bedfc67a"
	TestServerID = "6dae42f8-4368-4678-94ff-3960e28e3630"
)
View Source
const (
	ClientID       = "AZURE_CLIENT_ID"
	ClientSecret   = "AAD_SERVICE_PRINCIPAL_CLIENT_SECRET"
	ClientCert     = "AZURE_CLIENT_CER"
	ClientCertPass = "AZURE_CLIENT_CERTIFICATE_PASSWORD"
	ResourceID     = "AZURE_RESOURCE_ID"
	TenantID       = "AZURE_TENANT_ID"
	BadSecret      = "Bad_Secret"
	Username       = "USERNAME"
	Password       = "PASSWORD"
)

Variables

This section is empty.

Functions

func ErrorContains

func ErrorContains(out error, want string) bool

ErrorContains takes an input error and a desired substring, checks if the string is present in the error message, and returns the boolean result

func GetVCRHttpClient

func GetVCRHttpClient(path, tenantID string) (*recorder.Recorder, error)

func ReplaceSecretValuesIncludingURLEscaped added in v0.1.1

func ReplaceSecretValuesIncludingURLEscaped(body, secret, redactionToken string) string

ReplaceSecretValuesIncludingURLEscaped takes an input string, finds any instances of the input secret in the string (including in URL-escaped format), and replaces all instances with the given redaction token This is used for VCR tests as they sometimes include a URL-escaped version of the secret in the request body

Types

This section is empty.

Jump to

Keyboard shortcuts

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