youngkermit8-coder opened a new issue, #1703:
URL: https://github.com/apache/rocketmq-dashboard/issues/1703

   ## What happened
   
   `ToolGatewayServiceTest` has two startup-validation tests that mutate the 
canonical YAML catalog with `String.replace(...)`:
   
   - `failsStartupWhenToolSchemaContainsAnUnresolvedReference`
   - `failsStartupWhenToolSchemaViolatesTheJsonSchemaMetaSchema`
   
   On a Windows checkout, Spring reads `rmq-tools.yaml` with CRLF line endings 
while the Java text-block search strings contain LF line endings. Both 
replacements are therefore silent no-ops, so the tests load the unchanged valid 
catalog and fail with `Expecting code to raise a throwable`.
   
   ## Reproduction
   
   On Windows with JDK 21:
   
   ```text
   mvn -Dtest=ToolGatewayServiceTest test
   Tests run: 27, Failures: 2, Errors: 0, Skipped: 0
   ```
   
   Both failures are the tests above. Adding an assertion for the intended 
mutation confirms that neither invalid marker is present in the generated YAML.
   
   ## Expected behavior
   
   The test fixture should be line-ending independent, must verify that its 
mutation actually happened, and should exercise the existing startup schema 
validation on both LF and CRLF checkouts.
   
   ## Proposed fix
   
   Normalize the loaded catalog text to LF before applying mutations, use 
explicit schema fragments, and assert that each invalid marker was inserted 
before constructing `ToolCatalog`.
   


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