Fix #22: Improve alerting provider tests by mocking HTTP client

This commit is contained in:
TwiN
2021-12-02 23:10:21 -05:00
parent 6954e9dde7
commit 8c73ae6035
10 changed files with 661 additions and 0 deletions

9
test/mock.go Normal file
View 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
}