test: update integration tests for Echo v5 compatibility
Update all integration test files to work with Echo v5 changes. Changes in new_fixes_test.go: - Update test helper signatures for *echo.Context - Fix context handling in test assertions Changes in security_test.go: - Update security test signatures for Echo v5 Changes in test_helpers.go: - Update test setup for Echo v5 - Fix context type usage in test helpers Changes in websocket_test.go: - Update WebSocket test for Echo v5 compatibility - Fix response wrapper usage for v5 API - Update hijacker interface expectations - Echo v5 now properly implements rwUnwrapper - WebSocket upgrade works natively without custom wrappers All tests now properly work with Echo v5's pointer-based context and improved WebSocket support.
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -39,7 +39,7 @@ func TestRateLimiter(t *testing.T) {
|
||||
e := echo.New()
|
||||
|
||||
// Create a simple handler
|
||||
handler := func(c echo.Context) error {
|
||||
handler := func(c *echo.Context) error {
|
||||
return c.String(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ func (m *mockRateLimiter) Allow(ip string) bool {
|
||||
|
||||
func rateLimiterMiddleware(rl *mockRateLimiter) echo.MiddlewareFunc {
|
||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
return func(c *echo.Context) error {
|
||||
ip := c.RealIP()
|
||||
if ip == "" {
|
||||
ip = c.Request().RemoteAddr
|
||||
|
||||
Reference in New Issue
Block a user