v0.0.364 add ServerHTTP() to GinWrapper for integration testing
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m59s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m59s
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/rext"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -185,3 +186,10 @@ func (w *GinWrapper) cleanMiddlewareName(fname string) string {
|
||||
|
||||
return fname
|
||||
}
|
||||
|
||||
// ServeHTTP only used for unit tests
|
||||
func (w *GinWrapper) ServeHTTP(req *http.Request) *httptest.ResponseRecorder {
|
||||
respRec := httptest.NewRecorder()
|
||||
w.engine.ServeHTTP(respRec, req)
|
||||
return respRec
|
||||
}
|
||||
|
Reference in New Issue
Block a user