fix: Add default values to DaprClientProperties for Spring Boot apps#1697
Draft
siri-varma wants to merge 3 commits intodapr:masterfrom
Draft
fix: Add default values to DaprClientProperties for Spring Boot apps#1697siri-varma wants to merge 3 commits intodapr:masterfrom
siri-varma wants to merge 3 commits intodapr:masterfrom
Conversation
When starting a Spring Boot application without explicitly setting DaprClientProperties, fields are now initialized with Dapr's standard defaults instead of null: httpEndpoint=http://localhost, grpcEndpoint=localhost, httpPort=3500, grpcPort=50001, apiToken=null. Fixes dapr#1566 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Siri Varma Vegiraju <svegiraju@Siris-MacBook-Pro.local>
d91dc5c to
82c65c3
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to ensure DaprClientProperties in the Spring Boot integration are initialized with Dapr-standard defaults when users don’t explicitly configure dapr.client.*, addressing #1566.
Changes:
- Add default endpoint/port constants and initialize
DaprClientPropertiesfields with those defaults. - Extend
DaprClientPropertiesTestwith new assertions for defaults (no-arg constructor and Spring context binding). - Update the setter-based test to validate non-default/custom values.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| dapr-spring/dapr-spring-boot-properties/src/main/java/io/dapr/spring/boot/properties/client/DaprClientProperties.java | Introduces default constants and non-null default field initialization for client endpoints/ports. |
| dapr-spring/dapr-spring-boot-properties/src/test/java/io/dapr/spring/boot/properties/client/DaprClientPropertiesTest.java | Adds/updates tests validating default values and property mapping behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...oot-properties/src/main/java/io/dapr/spring/boot/properties/client/DaprClientProperties.java
Outdated
Show resolved
Hide resolved
...properties/src/test/java/io/dapr/spring/boot/properties/client/DaprClientPropertiesTest.java
Show resolved
Hide resolved
...properties/src/test/java/io/dapr/spring/boot/properties/client/DaprClientPropertiesTest.java
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1697 +/- ##
============================================
- Coverage 79.53% 79.41% -0.13%
+ Complexity 2193 2189 -4
============================================
Files 237 237
Lines 6577 6577
Branches 730 730
============================================
- Hits 5231 5223 -8
Misses 990 990
- Partials 356 364 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When starting a Spring Boot application without explicitly setting DaprClientProperties, fields are now initialized with Dapr's standard defaults instead of null: httpEndpoint=http://localhost, grpcEndpoint=localhost, httpPort=3500, grpcPort=50001, apiToken=null.
Fixes #1566
Description
Please explain the changes you've made
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #1566
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: