feat: DefaultValueStrategy#43
Conversation
This change introduces DefaultValueStrategy to allow users to choose between using Kotlin default values for optional parameters (UseDefault) or generating new values through the resolver chain (Generate). - Added DefaultValueStrategy configuration type. - Updated SomeConfig and SomeConfigBuilder to include the new strategy. - Updated DataClassResolver to respect the configured strategy. - Added FixtureContext.defaultValueStrategy for custom factories. - Added integration tests covering all strategy behaviors. - Updated documentation. Co-authored-by: MessiasLima <10220064+MessiasLima@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request introduces a DefaultValueStrategy to control whether data class constructor parameters with default values should use their Kotlin defaults or be replaced with generated fixture values. The implementation includes a new sealed interface, updates to the configuration and builder, and logic within the DataClassResolver. Documentation and integration tests have also been added. Feedback from the reviewer suggests adding trailing commas in several parameter and argument lists to improve consistency and adhere to Kotlin style guide recommendations.
Implemented DefaultValueStrategy to control how data class constructor defaults are handled. The default behavior remains backward compatible (UseDefault), but users can now opt into generating values for all optional parameters using DefaultValueStrategy.Generate. Added tests and documentation.
Fixes #42
PR created automatically by Jules for task 16197569111996853182 started by @MessiasLima