Skip to content

fix: Add default values to DaprClientProperties for Spring Boot apps#1697

Draft
siri-varma wants to merge 3 commits intodapr:masterfrom
siri-varma:users/svegiraju/add-defaults
Draft

fix: Add default values to DaprClientProperties for Spring Boot apps#1697
siri-varma wants to merge 3 commits intodapr:masterfrom
siri-varma:users/svegiraju/add-defaults

Conversation

@siri-varma
Copy link
Contributor

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:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

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>
@siri-varma siri-varma force-pushed the users/svegiraju/add-defaults branch from d91dc5c to 82c65c3 Compare March 13, 2026 22:58
@siri-varma siri-varma marked this pull request as ready for review March 13, 2026 23:05
@siri-varma siri-varma requested review from a team as code owners March 13, 2026 23:05
@siri-varma siri-varma requested a review from Copilot March 13, 2026 23:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 DaprClientProperties fields with those defaults.
  • Extend DaprClientPropertiesTest with 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.

siri-varma and others added 2 commits March 13, 2026 16:19
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
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.41%. Comparing base (f63a4a4) to head (f83cd72).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@siri-varma siri-varma marked this pull request as draft March 14, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DaprClientProperties don't have defaults set

2 participants