mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-12 16:23:03 +03:00
Co-authored-by: Kyle Mendell <ksm@ofkm.us> Co-authored-by: Kyle Mendell <kmendell@ofkm.us> Co-authored-by: Elias Schneider <login@eliasschneider.com>
29 lines
719 B
Go
29 lines
719 B
Go
//go:build e2etest
|
|
|
|
package bootstrap
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"gorm.io/gorm"
|
|
|
|
"github.com/pocket-id/pocket-id/backend/internal/controller"
|
|
"github.com/pocket-id/pocket-id/backend/internal/service"
|
|
)
|
|
|
|
// When building for E2E tests, add the e2etest controller
|
|
func init() {
|
|
registerTestControllers = []func(apiGroup *gin.RouterGroup, db *gorm.DB, svc *services){
|
|
func(apiGroup *gin.RouterGroup, db *gorm.DB, svc *services) {
|
|
testService, err := service.NewTestService(db, svc.appConfigService, svc.jwtService, svc.ldapService)
|
|
if err != nil {
|
|
log.Fatalf("failed to initialize test service: %v", err)
|
|
return
|
|
}
|
|
|
|
controller.NewTestController(apiGroup, testService)
|
|
},
|
|
}
|
|
}
|