mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2026-04-22 02:31:54 +02:00
test: reactions (#1081)
This commit is contained in:
19
testing/recordingserver.go
Normal file
19
testing/recordingserver.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package testing
|
||||
|
||||
import "net/http"
|
||||
|
||||
type RecordingServer struct {
|
||||
Entries []string
|
||||
}
|
||||
|
||||
func NewRecordingServer() *RecordingServer {
|
||||
return &RecordingServer{}
|
||||
}
|
||||
|
||||
func (s *RecordingServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
s.Entries = append(s.Entries, r.URL.Path)
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write([]byte(`{"test":true}`)) //nolint:errcheck
|
||||
}
|
||||
Reference in New Issue
Block a user