Skip to content

feat: DefaultValueStrategy#43

Merged
MessiasLima merged 3 commits into
mainfrom
feature/default-value-strategy-16197569111996853182
May 19, 2026
Merged

feat: DefaultValueStrategy#43
MessiasLima merged 3 commits into
mainfrom
feature/default-value-strategy-16197569111996853182

Conversation

@MessiasLima
Copy link
Copy Markdown
Owner

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

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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/main/kotlin/dev/appoutlet/some/config/SomeConfig.kt Outdated
Comment thread src/main/kotlin/dev/appoutlet/some/core/FixtureContext.kt Outdated
Comment thread src/main/kotlin/dev/appoutlet/some/resolver/CustomTypeFactoryResolver.kt Outdated
Comment thread src/main/kotlin/dev/appoutlet/some/resolver/CustomTypeFactoryResolver.kt Outdated
@MessiasLima MessiasLima changed the title Add DefaultValueStrategy for data class constructor defaults feat: DefaultValueStrategy May 19, 2026
@MessiasLima MessiasLima merged commit 68eb87b into main May 19, 2026
1 check passed
@MessiasLima MessiasLima deleted the feature/default-value-strategy-16197569111996853182 branch May 19, 2026 17:34
@github-project-automation github-project-automation Bot moved this from Ready to Done in Some May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add DefaultValueStrategy for data class constructor defaults

1 participant