Documentation
¶
Overview ¶
Package testutils provides utilities for use in tests
Index ¶
- Variables
- func CreateSessionManager() sessions.Store[map[string]any]
- func CreateTokenManager(refreshOverlap time.Duration) (*tokens.TokenManager, error)
- func MockStorageService(t *testing.T, uploader storage.UploaderFunc) (*objects.Service, error)
- func MockStorageServiceWithValidation(t *testing.T, uploader storage.UploaderFunc, ...) (*objects.Service, error)
- func MockStorageServiceWithValidationAndProvider(t *testing.T, uploader storage.UploaderFunc, ...) (*objects.Service, *mock_shared.MockProvider, error)
- func NewRedisClient() *redis.Client
- func TestClient(c *ent.Client, objectStore *objects.Service, ...) (*testclient.TestClient, error)
- func TestClientWithAuth(c *ent.Client, objectStore *objects.Service, ...) (*testclient.TestClient, error)
- func TestRestClient(c *ent.Client, opts ...openlaneclient.ClientOption) (*openlaneclient.OpenlaneClient, error)
Constants ¶
This section is empty.
Variables ¶
var ( MaxResultLimit = 10 TrustCenterCnameTarget = "cname.test.net" TrustCenterDefaultDomain = "trust.test.net" )
Functions ¶
func CreateSessionManager ¶
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
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 ¶
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
func TestRestClient(c *ent.Client, opts ...openlaneclient.ClientOption) (*openlaneclient.OpenlaneClient, error)
TestRestClient creates a new OpenlaneClient for testing
Types ¶
This section is empty.