TestMiddlewareAbort() — gin Function Reference
Architecture documentation for the TestMiddlewareAbort() function in middleware_test.go from the gin codebase.
Entity Profile
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
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free