MCPcopy
hub / github.com/gin-gonic/gin / TestEngineHandleMethodNotAllowedCornerCase

Function TestEngineHandleMethodNotAllowedCornerCase

routes_test.go:774–791  ·  routes_test.go::TestEngineHandleMethodNotAllowedCornerCase
(t *testing.T)

Source from the content-addressed store, hash-verified

772}
773
774func TestEngineHandleMethodNotAllowedCornerCase(t *testing.T) {
775 r := New()
776 r.HandleMethodNotAllowed = true
777
778 base := r.Group("base")
779 base.GET("/metrics", handlerTest1)
780
781 v1 := base.Group("v1")
782
783 v1.GET("/:id/devices", handlerTest1)
784 v1.GET("/user/:id/groups", handlerTest1)
785
786 v1.GET("/orgs/:id", handlerTest1)
787 v1.DELETE("/orgs/:id", handlerTest1)
788
789 w := PerformRequest(r, http.MethodGet, "/base/v1/user/groups")
790 assert.Equal(t, http.StatusNotFound, w.Code)
791}

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
PerformRequestFunction · 0.85
GroupMethod · 0.65
GETMethod · 0.65
DELETEMethod · 0.65

Tested by

no test coverage detected