TestMiddlewareAbort() — gin Function Reference
Architecture documentation for the TestMiddlewareAbort() function in middleware_test.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD 77850c4e_cf72_1e8d_6e72_09b7639dfc01["TestMiddlewareAbort()"] 6ffd4e0d_9875_7480_fa1d_168c8f7de415["middleware_test.go"] 77850c4e_cf72_1e8d_6e72_09b7639dfc01 -->|defined in| 6ffd4e0d_9875_7480_fa1d_168c8f7de415 style 77850c4e_cf72_1e8d_6e72_09b7639dfc01 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
middleware_test.go lines 159–183
func TestMiddlewareAbort(t *testing.T) {
signature := ""
router := New()
router.Use(func(c *Context) {
signature += "A"
})
router.Use(func(c *Context) {
signature += "C"
c.AbortWithStatus(http.StatusUnauthorized)
c.Next()
signature += "D"
})
router.GET("/", func(c *Context) {
signature += " X "
c.Next()
signature += " XX "
})
// RUN
w := PerformRequest(router, http.MethodGet, "/")
// TEST
assert.Equal(t, http.StatusUnauthorized, w.Code)
assert.Equal(t, "ACD", signature)
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does TestMiddlewareAbort() do?
TestMiddlewareAbort() is a function in the gin codebase, defined in middleware_test.go.
Where is TestMiddlewareAbort() defined?
TestMiddlewareAbort() is defined in middleware_test.go at line 159.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free