Vaultx.Test.Mocks (Vaultx v0.7.0)
View SourceCentralized mock definitions for comprehensive Vaultx testing.
This module defines and manages all mocks used throughout the Vaultx test suite, providing consistent, reliable interfaces for testing HTTP clients, authentication methods, and external dependencies. It ensures test isolation and predictable behavior across the entire test suite.
Mock Architecture
- HTTP Client Mock: Complete HTTP transport layer mocking
- Authentication Mocks: Various auth method implementations
- External Service Mocks: Third-party service integrations
- Global Configuration: Consistent mock setup across tests
Usage
# In test_helper.exs
Vaultx.Test.Mocks.setup_mocks()
# In individual tests
import Vaultx.Test.HTTPHelpers
expect_get(200, %{"data" => "test"})References
- Mox Library - Mock and stub library
- Testing Guide - Elixir testing best practices