Eppiehu opened a new pull request, #11414: URL: https://github.com/apache/rocketmq/pull/11414
### Which Issue(s) This PR Fixes Fixes #11413 ### Brief Description Preserve the `-p/--body` value in `mqadmin sendMessage` without trimming it before UTF-8 encoding. Previously, leading and trailing payload whitespace was removed, and whitespace-only bodies became empty bodies. Add command-level regression tests that capture the `Message` passed to a mocked producer. They cover tabs/newlines, whitespace-only bodies, an explicit target queue with UTF-8 content, and ordinary bodies. Each new test uses an isolated command and producer. ### How Did You Test This Change? - Confirmed the whitespace regression fails before the production fix: 12 expected body bytes versus 7 actual bytes. - `SendMessageCommandTest`: 5 tests passed, with no failures, errors, or skipped tests. - Maven compile with Checkstyle and SpotBugs passed for the tools reactor. - `git diff --check` passed. Local commands: ```text mvn -o -B -pl tools -am -Dtest=SendMessageCommandTest -Dsurefire.failIfNoSpecifiedTests=false -Dspotbugs.skip=true -Djacoco.skip=true test mvn -o -B -pl tools -am -DskipTests -Djacoco.skip=true compile ``` Validated on Windows 11 with JDK 17.0.19 and Maven 3.9.16. Tests use a mocked producer and do not send messages to a Broker. JaCoCo coverage and the full repository test suite were not run locally. -- 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]
