quzizii opened a new issue, #10475: URL: https://github.com/apache/rocketmq/issues/10475
### Before Creating the Enhancement Request - [x] I have confirmed that this should be classified as an enhancement rather than a bug/feature. ### Summary `CleanupPolicyUtils` resolves the cleanup policy from `TopicConfig` attributes and determines whether a topic uses compaction. This issue proposes adding focused unit tests for its observable behavior. ### Motivation `CleanupPolicyUtils` is used to interpret the `cleanup.policy` topic attribute. Without regression coverage, future changes may accidentally break: - fallback to the default cleanup policy - handling of missing or empty topic attributes - resolution of explicit `DELETE` and `COMPACTION` policies - compaction detection behavior ### Describe the Solution You'd Like Add unit tests under `common/src/test/java/org/apache/rocketmq/common/utils/` to cover: - `getDeletePolicy(Optional.empty())` - `getDeletePolicy()` when `TopicConfig` attributes are `null` - `getDeletePolicy()` when attributes are empty - `getDeletePolicy()` when `cleanup.policy` is missing - explicit `cleanup.policy=DELETE` - explicit `cleanup.policy=COMPACTION` - invalid cleanup policy value - `isCompaction()` for both compaction and non-compaction cases The scope should stay limited to unit tests. No production logic changes are required. ### Describe Alternatives You've Considered Expanding the test scope to topic creation or broker-level behavior was considered unnecessary because this is a focused utility-level regression test. ### Additional Context _No response_ -- 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]
