skytin1004 opened a new pull request, #906: URL: https://github.com/apache/fesod/pull/906
<!-- Thanks very much for contributing to Apache Fesod (Incubating)! Please make sure that your code changes are covered with tests. And in case of new features or big changes remember to adjust the documentation. Feel free to ping committers for the review! In case of an existing issue, reference it using one of the following: Closed: #ISSUE Related: #ISSUE --> ## Purpose of the pull request <!-- Describe the purpose of this pull request. For example: Closed: #ISSUE--> I've added test coverage for converter precedence when both a field-level converter and a registered converter could apply to the same Java type. The behavior I wanted to lock down is that a converter declared directly on a field with `@ExcelProperty(converter = ...)` should take precedence over a converter registered through `registerConverter(...)`. ## What's changed? <!--- Describe the change below, including rationale and design decisions --> Added a regression test in `CustomConverterTest` for this case. The test writes a CSV with two `String` fields. One field has a field-level converter declared with `@ExcelProperty`, and the other field has no field-level converter, so it should use the registered `String` converter. The expected output contains both converted values: `field:value,registered:value`. This verifies the registered converter is actually active for the unannotated field and the field-level converter still takes precedence for the annotated field. This is useful because users may register a general converter as a default behavior, while still expecting field-specific converters to override it for special cases. Tested with `bash ./mvnw -pl fesod-sheet -Dmaven.test.skip=false -Dtest=CustomConverterTest test`. Result: `Tests run: 7, Failures: 0, Errors: 0, Skipped: 0`. ## Checklist - [x] I have read the [Contributor Guide](https://fesod.apache.org/community/contribution/). - [x] I have written the necessary doc or comment. - [x] I have added the necessary unit tests and all cases have passed. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
