@@ -269,7 +269,8 @@ void testChallengeMetricsIncrement() {
269
269
.andExpect (status ().isOk ())
270
270
.andExpect (jsonPath ("$.measurements[0].value" , is ((double ) i )))
271
271
.andExpect (jsonPath ("$.availableTags[?(@.tag=='difficulty')].values[0]" , hasItem ("1000" )))
272
- .andExpect (jsonPath ("$.availableTags[?(@.tag=='site_key')].values[0]" , hasItem ("test_site" )));
272
+ .andExpect (jsonPath ("$.availableTags[?(@.tag=='site_key')].values[0]" , hasItem ("test_site" )))
273
+ .andExpect (jsonPath ("$.availableTags[?(@.tag=='same_source_address_request_count')].values[*]" , hasItem (String .valueOf (i ))));
273
274
}
274
275
}
275
276
@@ -299,15 +300,17 @@ void testVerifyMetricsIncrement() {
299
300
.andExpect (status ().isOk ())
300
301
.andExpect (jsonPath ("$.measurements[0].value" , is ((double ) i )))
301
302
.andExpect (jsonPath ("$.availableTags[?(@.tag=='difficulty')].values[0]" , hasItem ("1000" )))
302
- .andExpect (jsonPath ("$.availableTags[?(@.tag=='site_key')].values[0]" , hasItem ("test_site" )));
303
+ .andExpect (jsonPath ("$.availableTags[?(@.tag=='site_key')].values[0]" , hasItem ("test_site" )))
304
+ .andExpect (jsonPath ("$.availableTags[?(@.tag=='same_source_address_request_count')]" ).exists ());
303
305
304
306
mockMvc .perform (get ("/actuator/metrics/captcha.client.solve.time" ))
305
307
.andExpect (status ().isOk ())
306
308
.andExpect (jsonPath ("$.measurements[?(@.statistic=='COUNT')].value" , hasItem ((double ) i )))
307
309
.andExpect (jsonPath ("$.measurements[?(@.statistic=='TOTAL')].value" , hasItem ((double ) i * TEST_PAYLOAD .getTook ())))
308
310
.andExpect (jsonPath ("$.measurements[?(@.statistic=='MAX')].value" , hasItem ((double ) TEST_PAYLOAD .getTook ())))
309
311
.andExpect (jsonPath ("$.availableTags[?(@.tag=='difficulty')].values[0]" , hasItem ("1000" )))
310
- .andExpect (jsonPath ("$.availableTags[?(@.tag=='site_key')].values[0]" , hasItem ("test_site" )));
312
+ .andExpect (jsonPath ("$.availableTags[?(@.tag=='site_key')].values[0]" , hasItem ("test_site" )))
313
+ .andExpect (jsonPath ("$.availableTags[?(@.tag=='same_source_address_request_count')]" ).exists ());
311
314
312
315
databaseTestUtil .clearDatabase ();
313
316
}
0 commit comments