Skip to content

Commit e135435

Browse files
author
QTom
committed
fix: sync test constructor calls with new rpmCache parameter
Add missing nil argument for rpmCache to NewAccountHandler (5 sites) and NewGatewayService (2 sites) after RPM feature expanded their signatures.
1 parent cd09adc commit e135435

7 files changed

Lines changed: 8 additions & 4 deletions

backend/internal/handler/admin/account_data_handler_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func setupAccountDataRouter() (*gin.Engine, *stubAdminService) {
6464
nil,
6565
nil,
6666
nil,
67+
nil,
6768
)
6869

6970
router.GET("/api/v1/admin/accounts/data", h.ExportData)

backend/internal/handler/admin/account_handler_mixed_channel_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func setupAccountMixedChannelRouter(adminSvc *stubAdminService) *gin.Engine {
1616
gin.SetMode(gin.TestMode)
1717
router := gin.New()
18-
accountHandler := NewAccountHandler(adminSvc, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
18+
accountHandler := NewAccountHandler(adminSvc, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
1919
router.POST("/api/v1/admin/accounts/check-mixed-channel", accountHandler.CheckMixedChannel)
2020
router.POST("/api/v1/admin/accounts", accountHandler.Create)
2121
router.PUT("/api/v1/admin/accounts/:id", accountHandler.Update)

backend/internal/handler/admin/account_handler_passthrough_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func TestAccountHandler_Create_AnthropicAPIKeyPassthroughExtraForwarded(t *testi
2828
nil,
2929
nil,
3030
nil,
31+
nil,
3132
)
3233

3334
router := gin.New()

backend/internal/handler/admin/batch_update_credentials_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (f *failingAdminService) UpdateAccount(ctx context.Context, id int64, input
3636
func setupAccountHandlerWithService(adminSvc service.AdminService) (*gin.Engine, *AccountHandler) {
3737
gin.SetMode(gin.TestMode)
3838
router := gin.New()
39-
handler := NewAccountHandler(adminSvc, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
39+
handler := NewAccountHandler(adminSvc, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
4040
router.POST("/api/v1/admin/accounts/batch-update-credentials", handler.BatchUpdateCredentials)
4141
return router, handler
4242
}

backend/internal/handler/gateway_handler_warmup_intercept_unit_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ func newTestGatewayHandler(t *testing.T, group *service.Group, accounts []*servi
153153
nil, // deferredService
154154
nil, // claudeTokenProvider
155155
nil, // sessionLimitCache
156+
nil, // rpmCache
156157
nil, // digestStore
157158
)
158159

backend/internal/handler/sora_gateway_handler_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,8 @@ func TestSoraGatewayHandler_ChatCompletions(t *testing.T) {
426426
deferredService,
427427
nil,
428428
testutil.StubSessionLimitCache{},
429-
nil,
429+
nil, // rpmCache
430+
nil, // digestStore
430431
)
431432

432433
soraClient := &stubSoraClient{imageURLs: []string{"https://example.com/a.png"}}

backend/internal/server/api_contract_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ func newContractDeps(t *testing.T) *contractDeps {
624624
apiKeyHandler := handler.NewAPIKeyHandler(apiKeyService)
625625
usageHandler := handler.NewUsageHandler(usageService, apiKeyService)
626626
adminSettingHandler := adminhandler.NewSettingHandler(settingService, nil, nil, nil, nil)
627-
adminAccountHandler := adminhandler.NewAccountHandler(adminService, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
627+
adminAccountHandler := adminhandler.NewAccountHandler(adminService, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
628628

629629
jwtAuth := func(c *gin.Context) {
630630
c.Set(string(middleware.ContextKeyUser), middleware.AuthSubject{

0 commit comments

Comments
 (0)