fix: new test and extract time.Now to mockable Clock #181
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 49s

This commit is contained in:
2024-10-05 23:40:37 +02:00
parent f7934f42db
commit fa6e038431
5 changed files with 73 additions and 12 deletions

View File

@@ -16,8 +16,9 @@ func GetHandler(d *sql.DB, serverSettings *types.ServerSettings) http.Handler {
router.HandleFunc("/", service.HandleIndexAnd404(d, serverSettings))
randomGenerator := service.NewRandomGeneratorImpl()
clock := service.NewClockImpl()
dbAuth := db.NewDbAuthSqlite(d)
serviceAuth := service.NewServiceAuthImpl(dbAuth, randomGenerator, serverSettings)
serviceAuth := service.NewServiceAuthImpl(dbAuth, randomGenerator, clock, serverSettings)
handlerAuth := NewHandlerAuth(d, serviceAuth, serverSettings)
// Serve static files (CSS, JS and images)