chstercc opened a new pull request, #6930:
URL: https://github.com/apache/rocketmq-dashboard/pull/6930
### Which Issue(s) This PR Fixes
- Fixes #6832
### Brief Description
`ClusterVO` carries `gmtCreate` / `gmtModified`, left over from the
persisted-entity shape. Clusters are discovered from the NameServer and cached
by name, so nothing ever fills either field, yet both serialized as `null` on
every entry of `GET /api/clusters` and `GET /api/clusters/{id}`. `ClusterInfo`
in `docs/api-spec.md` declares neither.
Mark the two fields `@JsonIgnore`, leaving the rest of the view class
untouched, and pin the payload shape with a regression that checks the JSON
keys rather than their (null) values.
### How Did You Test This Change?
- `cd server && mvn -B -ntp
-Dtest='ClusterControllerTest#listClustersShouldNotSerializeFieldsOutsideTheContractTest'
test` — fails on the parent commit (`gmtCreate` is present) and passes after
the change.
- `cd server && mvn -B -ntp
-Dtest='ClusterControllerTest,ClusterServiceTest,ClusterServiceRegistryTest,ClusterRepositoryImplTest,ClusterConnectionServiceTest,BrokerConfigDiffServiceTest,RealClusterProviderTest,RegistryProbeRunnerTest,RocketMQClusterProviderTest'
test` — 138 passed, including the checkstyle `validate` phase.
- The full `mvn test` suite was not run: its `@SpringBootTest` integration
tests read and write a real MySQL datasource, and this change is confined to
the JSON serialization of one view class.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`fix:`)
- [x] Tests added or updated for non-trivial changes, test method ends in
`Test`
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
(no UI text)
- [x] Architecture constraints stay green (no architecture rule touched)
- [x] New source files carry the ASF license header (no new source files)
- [x] Documentation touched where behaviour changed (the code now matches
the already-documented contract)
--
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]