MockHTTPClientWithHandler creates an HTTP client with a single handler function
(handler http.HandlerFunc)
| 674 | |
| 675 | // MockHTTPClientWithHandler creates an HTTP client with a single handler function |
| 676 | func MockHTTPClientWithHandler(handler http.HandlerFunc) *http.Client { |
| 677 | handlers := map[string]http.HandlerFunc{ |
| 678 | "": handler, // Empty key acts as catch-all |
| 679 | } |
| 680 | return MockHTTPClientWithHandlers(handlers) |
| 681 | } |
| 682 | |
| 683 | // MockHTTPClientWithHandlers creates an HTTP client with multiple handlers for different paths |
| 684 | func MockHTTPClientWithHandlers(handlers map[string]http.HandlerFunc) *http.Client { |
no test coverage detected