yyqdbngt opened a new pull request, #3242: URL: https://github.com/apache/rocketmq-dashboard/pull/3242
## Summary Adds `MetricsSourceFactoryTest`, a first unit test for the metrics backend factory. It verifies the provider-type → concrete-source mapping without any network: the shared `RestClient` configuration is asserted via a mocked `RestClient.Builder`. Coverage: - each provider type (`Prometheus`, `VictoriaMetrics`, `Thanos`, `Cortex`, `Mimir`, `ARMS`) resolves to its concrete `AbstractPrometheusCompatibleMetricsSource` subclass with the matching `MetricsBackendType`; `Custom` shares the Prometheus implementation but keeps its `CUSTOM` backend identity; - missing and unknown provider types default to Prometheus, and provider-name normalization tolerates whitespace/underscores (`victoria_metrics`); - every created source is configured through the shared redirect-guarded client chain: `NoRedirectClientHttpRequestFactory` is installed and `build()` is invoked. ## Why The factory decides which query-path semantics a configured data source gets; `MetricsBackendType` was already covered but the factory wiring was not. ## Testing `mvn -B test -Dtest=MetricsSourceFactoryTest` — 3/3 pass; checkstyle (validate) clean. -- 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]
