@@ -159,7 +159,7 @@ func TestAPIEndpoints(t *testing.T) {
159159 method string
160160 path string
161161 tenantID string
162- requestBody interface {}
162+ requestBody any
163163 expectedStatus int
164164 setupMock func (* bucket.ClientMock )
165165 validateResponse func (* testing.T , * httptest.ResponseRecorder )
@@ -182,7 +182,7 @@ func TestAPIEndpoints(t *testing.T) {
182182 mock .MockGet ("runtime.yaml" , "overrides:\n " , nil )
183183 },
184184 validateResponse : func (t * testing.T , recorder * httptest.ResponseRecorder ) {
185- var response map [string ]interface {}
185+ var response map [string ]any
186186 err := json .Unmarshal (recorder .Body .Bytes (), & response )
187187 require .NoError (t , err )
188188 assert .Empty (t , response )
@@ -202,7 +202,7 @@ func TestAPIEndpoints(t *testing.T) {
202202 mock .MockGet ("runtime.yaml" , overridesData , nil )
203203 },
204204 validateResponse : func (t * testing.T , recorder * httptest.ResponseRecorder ) {
205- var response map [string ]interface {}
205+ var response map [string ]any
206206 err := json .Unmarshal (recorder .Body .Bytes (), & response )
207207 require .NoError (t , err )
208208 assert .Equal (t , float64 (5000 ), response ["ingestion_rate" ])
@@ -228,15 +228,15 @@ func TestAPIEndpoints(t *testing.T) {
228228 method : "POST" ,
229229 path : "/api/v1/user-overrides" ,
230230 tenantID : "" ,
231- requestBody : map [string ]interface {} {"ingestion_rate" : 5000 },
231+ requestBody : map [string ]any {"ingestion_rate" : 5000 },
232232 expectedStatus : http .StatusUnauthorized ,
233233 },
234234 {
235235 name : "POST overrides - valid tenant ID, valid overrides" ,
236236 method : "POST" ,
237237 path : "/api/v1/user-overrides" ,
238238 tenantID : "user789" ,
239- requestBody : map [string ]interface {} {"ingestion_rate" : 5000 , "ruler_max_rules_per_rule_group" : 10 },
239+ requestBody : map [string ]any {"ingestion_rate" : 5000 , "ruler_max_rules_per_rule_group" : 10 },
240240 expectedStatus : http .StatusOK ,
241241 setupMock : func (mock * bucket.ClientMock ) {
242242 // Mock runtime config with allowed limits
@@ -262,7 +262,7 @@ api_allowed_limits:
262262 method : "POST" ,
263263 path : "/api/v1/user-overrides" ,
264264 tenantID : "user999" ,
265- requestBody : map [string ]interface {} {"invalid_limit" : 5000 },
265+ requestBody : map [string ]any {"invalid_limit" : 5000 },
266266 expectedStatus : http .StatusBadRequest ,
267267 setupMock : func (mock * bucket.ClientMock ) {
268268 // Mock runtime config with allowed limits (invalid_limit not included)
@@ -290,7 +290,7 @@ api_allowed_limits:
290290 method : "POST" ,
291291 path : "/api/v1/user-overrides" ,
292292 tenantID : "user999" ,
293- requestBody : map [string ]interface {} {"ingestion_rate" : 1500000 }, // Exceeds hard limit of 1000000
293+ requestBody : map [string ]any {"ingestion_rate" : 1500000 }, // Exceeds hard limit of 1000000
294294 expectedStatus : http .StatusBadRequest ,
295295 setupMock : func (mock * bucket.ClientMock ) {
296296 // Mock runtime config with per-user hard limits and allowed limits
@@ -577,7 +577,7 @@ api_allowed_limits:
577577 // Create the request
578578 var req * http.Request
579579 if tt .method == "POST" {
580- requestBody := map [string ]interface {} {"ingestion_rate" : 5000 }
580+ requestBody := map [string ]any {"ingestion_rate" : 5000 }
581581 body , err := json .Marshal (requestBody )
582582 require .NoError (t , err )
583583 req = httptest .NewRequest (tt .method , "/api/v1/user-overrides" , bytes .NewReader (body ))
0 commit comments