yyqdbngt opened a new pull request, #3627:
URL: https://github.com/apache/rocketmq-dashboard/pull/3627
### Summary
Adds the first dedicated unit test suite for
`MetricsDataSourceQueryRequest`, the cross-service request wrapping a
`MetricQueryDTO` with optional credentials.
The query is mandatory via a nested `@Valid` `@NotNull`, while instance id
and credentials stay optional; both secrets are excluded from `toString()`. The
tests cover the happy path, the missing-query rejection and the secret-leak
guard.
### Changes
-
`server/src/test/java/org/apache/rocketmq/studio/model/request/MetricsDataSourceQueryRequestTest.java`
- `acceptsCompleteRequest`: a valid query plus credentials passes.
- `rejectsMissingQuery`: a null query yields the `query is required`
violation.
- `instanceIdAndCredentialsRemainOptional`: all optional fields may be
absent.
- `secretsAreExcludedFromToString`: password and bearer token never appear
in the rendering.
### Testing
- `mvn -B test -Dtest=MetricsDataSourceQueryRequestTest` passes (4 tests,
all green).
--
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]