testutils

package
v0.41.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package testutils provides utilities for use in tests

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxResultLimit           = 10
	TrustCenterCnameTarget   = "cname.test.net"
	TrustCenterDefaultDomain = "trust.test.net"
)

Functions

func CreateSessionManager

func CreateSessionManager() sessions.Store[map[string]any]

CreateSessionManager creates a new session manager for testing

func CreateTokenManager

func CreateTokenManager(refreshOverlap time.Duration) (*tokens.TokenManager, error)

CreateTokenManager creates a new token manager for testing

func MockStorageService added in v0.39.0

func MockStorageService(t *testing.T, uploader storage.UploaderFunc) (*objects.Service, error)

MockStorageService creates a new storage service for testing with a mock storage backend

func MockStorageServiceWithValidation added in v0.39.0

func MockStorageServiceWithValidation(t *testing.T, uploader storage.UploaderFunc, validationFunc storage.ValidationFunc) (*objects.Service, error)

MockStorageServiceWithValidation creates a new storage service for testing with custom validation

func MockStorageServiceWithValidationAndProvider added in v0.39.0

func MockStorageServiceWithValidationAndProvider(t *testing.T, uploader storage.UploaderFunc, validationFunc storage.ValidationFunc) (*objects.Service, *mock_shared.MockProvider, error)

MockStorageServiceWithValidationAndProvider creates a new storage service for testing with custom validation and returns both the StorageService and the mock provider for setting up expectations

func NewRedisClient

func NewRedisClient() *redis.Client

NewRedisClient creates a new redis client for testing using miniredis

func TestClient added in v0.1.2

func TestClient(c *ent.Client, objectStore *objects.Service, opts ...openlaneclient.ClientOption) (*testclient.TestClient, error)

TestClient creates a new OpenlaneClient for testing

func TestClientWithAuth added in v0.1.2

func TestClientWithAuth(c *ent.Client, objectStore *objects.Service, opts ...openlaneclient.ClientOption) (*testclient.TestClient, error)

TestClientWithAuth creates a new OpenlaneClient for testing that includes the auth middleware

func TestRestClient added in v0.26.0

TestRestClient creates a new OpenlaneClient for testing

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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