TestNew | Basic idempotency with default configuration | First request executes handler, second request with same key returns cached response with Idempotent-Replayed: true header |
TestWithOptions_NoKey | Requests without idempotency key | All requests execute handler normally (no caching) |
TestWithOptions_DifferentKeys | Multiple requests with different keys | Each unique key executes handler independently |
TestWithOptions_CustomHeader | Custom header name configuration | Middleware uses custom header (e.g., X-Request-Id) for idempotency key |
TestWithOptions_Methods | Method filtering (POST only) | POST requests are cached, PUT requests are not cached |
TestWithOptions_GET | GET requests with idempotency key | GET requests bypass middleware (not cached by default) |
TestWithOptions_ResponseHeaders | Custom response headers | Cached response includes all custom headers from original response |
TestWithStore | Custom store integration | Middleware works with custom Store implementation |
TestMemoryStore | Memory store operations | Set, Get, and Delete operations work correctly |
TestMemoryStore_Expiry | Expired entries | Store returns nil for expired entries |
TestWithOptions_CustomKeyGenerator | User-scoped keys | Same idempotency key with different user IDs creates separate cache entries |
TestWithOptions_ResponseBody | JSON response caching | Complete response body (including JSON) is cached and replayed |