mirror of
https://github.com/TwiN/gatus.git
synced 2026-02-04 15:14:43 +00:00
Fix #22: Improve alerting provider tests by mocking HTTP client
This commit is contained in:
9
test/mock.go
Normal file
9
test/mock.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
import "net/http"
|
||||
|
||||
type MockRoundTripper func(r *http.Request) *http.Response
|
||||
|
||||
func (f MockRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) {
|
||||
return f(r), nil
|
||||
}
|
||||
Reference in New Issue
Block a user