📄️ Expiration Policy
Expiration policies in HTTP mocking allow developers to simulate how an API might respond differently over time or after a certain number of requests. This feature is particularly useful in testing scenarios where the behavior of an API changes, such as rate limiting, temporary outages, or conditional responses based on request count.
📄️ Stacked Mocks
When working with multiple mocks in JJ, managing them individually can become cumbersome, especially when they need to be active simultaneously. The stacked() context manager simplifies this by allowing you to stack multiple mocks into a single context manager. This ensures that all the specified mocks are registered upon entering the context and deregistered upon exiting, making your code cleaner and more maintainable.
📄️ Mock Inspection
Inspecting Registered Mocks
📄️ Detailed Logging
By default, the mock server logs basic information, showing the HTTP method and path for requests, and the status code for responses. For example:
📄️ Low Level API
The Low Level API in JJ provides direct access to the core functionalities, enabling fine-grained control over request matching, response handling, and interaction with remote mocks.