1
0
Fork 0
forked from forgejo/forgejo

[TESTS] testMiddlewareHook, dependency injection in integration tests

(cherry picked from commit 6623630d10)
This commit is contained in:
Earl Warren 2023-06-05 11:04:47 +02:00
parent 03936c6492
commit 5e30a4f950
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
6 changed files with 32 additions and 18 deletions

View file

@ -167,6 +167,10 @@ func Routes(ctx gocontext.Context) *web.Route {
mid = append(mid, user.GetNotificationCount)
mid = append(mid, repo.GetActiveStopwatch)
mid = append(mid, goGet)
middlewareHook := ctx.Value(web.KeyTestMiddlewareHook)
if middlewareHook != nil {
mid = append(mid, middlewareHook)
}
others := web.NewRoute()
others.Use(mid...)