Help us shape the future of Go! Take the 2026 Go Developer Survey

testhelpers

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockClient

func NewMockClient(t *testing.T, handler http.Handler) *jamfplatform.Client

NewMockClient creates a test HTTP server with automatic OAuth2 token handling and returns a configured *jamfplatform.Client pointed at the mock server. The provided handler receives all non-token requests. The server is automatically closed when the test completes.

func RespondJSON

func RespondJSON(w http.ResponseWriter, status int, body any)

RespondJSON writes a JSON response with the given status code and body.

Types

This section is empty.

Directories

Path Synopsis
Package accrequire carries the acceptance suite's credential gate: the JAMFPLATFORM_ACC_REQUIRE promotion of a skip into a failure, the dual-read of renamed acceptance variables, and the report to hand Jamf Support when credentials are supplied and refused.
Package accrequire carries the acceptance suite's credential gate: the JAMFPLATFORM_ACC_REQUIRE promotion of a skip into a failure, the dual-read of renamed acceptance variables, and the report to hand Jamf Support when credentials are supplied and refused.
Package gatewaystub serves one canned gateway reply to the real SDK, so a test can assert on an error the SDK itself classified.
Package gatewaystub serves one canned gateway reply to the real SDK, so a test can assert on an error the SDK itself classified.
Package iconmirror holds the shared plan-modifier assertion for attributes Jamf Pro derives from a Self Service icon id.
Package iconmirror holds the shared plan-modifier assertion for attributes Jamf Pro derives from a Self Service icon id.
Package keyedcategories holds the shared schema assertion for the elements of a Self Service category set or list.
Package keyedcategories holds the shared schema assertion for the elements of a Self Service category set or list.
Package listhydration is the estate-free guard for the list resource's config-generation path.
Package listhydration is the estate-free guard for the list resource's config-generation path.
Package nullprior holds the schema-wide guards for STYLE_GUIDE rule 1a: AssertOptionalBlockLeavesPlanUnknown for the "block goes from omitted to declared" failure, and AssertNoPlanCollapse for the condition under which a singleton-block leaf may leave a null prior Unknown.
Package nullprior holds the schema-wide guards for STYLE_GUIDE rule 1a: AssertOptionalBlockLeavesPlanUnknown for the "block goes from omitted to declared" failure, and AssertNoPlanCollapse for the condition under which a singleton-block leaf may leave a null prior Unknown.

Jump to

Keyboard shortcuts

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