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:
2026-03-06 14:00:56 -05:00
parent a38e4e79da
commit 2cdc2fc913
4 changed files with 119 additions and 102 deletions
+3 -3
View File
@@ -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