yyqdbngt opened a new pull request, #3828:
URL: https://github.com/apache/rocketmq-dashboard/pull/3828

   ### Motivation
   
   The existing `AlertRuleDurationTest` covers the compound `1h30m` parse, a 
null input and overflow rejection, but the individual unit conversions, 
malformed inputs and blank handling were untested.
   
   ### Changes
   
   - `parsesSingleAndCompoundUnits`: `ms`, `s`, `m`, `h`, `d`, `w` (7 days), 
`y` (365 days) and the compound `2w3d` all convert to their expected `Duration`.
   - `rejectsMalformedDurations`: unknown units, trailing numbers, reversed 
syntax and embedded whitespace raise the 400 invalid-duration error.
   - `treatsBlankValueAsZeroDuration`: a whitespace-only value maps to 
`Duration.ZERO`.
   
   ### Verification
   
   ```
   mvn -B test -Dtest=AlertRuleDurationTest
   [INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
   [INFO] BUILD SUCCESS
   ```


-- 
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]

Reply via email to