Copilot commented on code in PR #7056:
URL: https://github.com/apache/shenyu/pull/7056#discussion_r4032739992
##########
shenyu-plugin/shenyu-plugin-metrics/src/test/java/org/apache/shenyu/plugin/metrics/MetricsPluginTest.java:
##########
@@ -84,4 +88,32 @@ public void testGetOrder() {
public void testNamed() {
Assertions.assertEquals(metricsPlugin.named(),
PluginEnum.METRICS.getName());
}
+
+ @Test
+ public void testRequestTypeTotalIsNotLabelledByRawPath() {
+ MetricsRegister metricsRegister = Mockito.mock(MetricsRegister.class);
+ MetricsReporter.register(metricsRegister);
Review Comment:
This test mocks `MetricsRegister`, so it verifies only the one-value
increment; it would still pass if `MetricsReporter.register` continued
registering `{path, type}`, even though the Prometheus implementation would
reject that vector at runtime. Please also assert that registration uses
exactly the single `type` label (or exercise `PrometheusMetricsRegister`) so
the second changed contract is covered.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]