{"modulePath":"github.com/openshift-hyperfleet/hyperfleet-api","version":"v0.4.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package test\n\n## Variables\n\n```go\nvar ContextAccessToken = contextKeyAccessToken{}\n```\nContextAccessToken is the context key for access tokens (used by tests)\n\n## Functions\n\n```go\nfunc GetAccessTokenFromContext(ctx context.Context) string\n```\nGetAccessTokenFromContext extracts the access token from the context\n\n```go\nfunc WithAuthToken(ctx context.Context) openapi.RequestEditorFn\n```\nWithAuthToken returns a RequestEditorFn that adds the Authorization header from context\n\n```go\nfunc WithIdentityHeader(headerName, headerValue string) openapi.RequestEditorFn\n```\nWithIdentityHeader returns a RequestEditorFn that sets the caller identity header.\n\n## Types\n\n```go\ntype Helper struct {\n\tFactories     factories.Factories\n\tDBFactory     db.SessionFactory\n\tContainer     *container.Container\n\tAPIServer     *server.APIServer\n\tAppConfig     *config.ApplicationConfig\n\tJWTPrivateKey *rsa.PrivateKey\n\tJWTCA         *rsa.PublicKey\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewHelper() *Helper\n```\n\n```go\nfunc RegisterIntegration(t *testing.T) (*Helper, *openapi.ClientWithResponses)\n```\nRegisterIntegration Register a test This should be run before every integration test\n\n```go\nfunc (helper *Helper) CleanDB() error\n```\n\n```go\nfunc (helper *Helper) CreateJWTString(account *TestAccount) string\n```\n\n```go\nfunc (helper *Helper) IdentityHeaderName() string\n```\nIdentityHeaderName returns the configured identity header name from the first JWT issuer config.\n\n```go\nfunc (helper *Helper) MigrateDB() error\n```\n\n```go\nfunc (helper *Helper) NewAPIClient() *openapi.ClientWithResponses\n```\n\n```go\nfunc (helper *Helper) NewAccount(username, name, email string) *TestAccount\n```\n\n```go\nfunc (helper *Helper) NewAuthenticatedContext(account *TestAccount) context.Context\n```\n\n```go\nfunc (helper *Helper) NewID() string\n```\nNewID creates a new unique ID used internally\n\n```go\nfunc (helper *Helper) NewRandAccount() *TestAccount\n```\n\n```go\nfunc (helper *Helper) RebuildSchema() error\n```\n\n```go\nfunc (helper *Helper) ResetDB() error\n```\n\n```go\nfunc (helper *Helper) RestURL(path string) string\n```\n\n```go\nfunc (helper *Helper) Teardown()\n```\n\n```go\ntype TestAccount struct {\n\tUsername  string\n\tFirstName string\n\tLastName  string\n\tEmail     string\n}\n```\n\n","path":"github.com/openshift-hyperfleet/hyperfleet-api/test","name":"test","synopsis":"","isRedistributable":true}
