TestNew | Basic maintenance mode enabled | Returns 503 with default message “Service is under maintenance” |
TestNew_Disabled | Maintenance mode disabled | Returns 200 and passes through to handler |
TestWithOptions_CustomMessage | Custom maintenance message | Returns 503 with custom message “We’ll be back soon!” |
TestWithOptions_RetryAfter | Custom retry-after value | Sets Retry-After header to 7200 seconds |
TestWithOptions_Whitelist (whitelisted IP) | IP in whitelist accesses endpoint | Returns 200 and bypasses maintenance mode |
TestWithOptions_Whitelist (non-whitelisted IP) | IP not in whitelist accesses endpoint | Returns 503 in maintenance mode |
TestWithOptions_WhitelistPaths (whitelisted path) | Access to /health whitelisted path | Returns 200 and bypasses maintenance mode |
TestWithOptions_WhitelistPaths (non-whitelisted path) | Access to /api non-whitelisted path | Returns 503 in maintenance mode |
TestWithOptions_CustomHandler | Custom handler for maintenance response | Returns JSON response with custom handler |
TestMode | Mode creation, enable, disable, toggle | Correctly changes state: disabled by default, enabled after Enable(), disabled after Disable(), enabled after Toggle() |
TestMode_Middleware (disabled) | Middleware with Mode disabled | Returns 200 and passes through |
TestMode_Middleware (enabled) | Middleware with Mode enabled | Returns 503 in maintenance mode |
TestScheduledMaintenance | Scheduled maintenance in the past | Returns 200 as maintenance period has ended |