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

This commit is contained in:
2024-10-05 23:40:37 +02:00
parent 6b033e2c2e
commit 3232632200
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)