Skip to content

feat: Default DaprContainer settings for Spring Boot apps - #1842

Merged
javier-aliaga merged 1 commit into
dapr:masterfrom
matheusandre1:feat/dapr-container-spring-boot-defaults
Oct 20, 2026
Merged

javier-aliaga merged 1 commit into
dapr:masterfrom
matheusandre1:feat/dapr-container-spring-boot-defaults

Conversation

@matheusandre1

Copy link
Copy Markdown
Contributor

Description

Reduces the configuration needed to use DaprContainer in tests (#1583).

  • Default actor state store: the in-memory kvstore created when no components are added now sets actorStateStore=true, so actors and workflows work out of the box.

  • Spring Boot defaults: a new auto-configuration in dapr-spring-boot-tests customizes the @ServiceConnection DaprContainer when the app runs an embedded web server on a fixed port:

    • appPort defaults to server.port (8080 if unset);
    • appChannelAddress defaults to host.testcontainers.internal and the port is exposed to containers;
    • appHealthCheckPath defaults to <actuator base-path>/health when actuator is on the classpath and served on the app port.

    Explicitly set values are never overridden. Random ports (server.port=0) and non-web contexts are skipped. It can be disabled with dapr.testcontainers.app-defaults.enabled=false.

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.

Closes: #1583

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

@matheusandre1
matheusandre1 force-pushed the feat/dapr-container-spring-boot-defaults branch 5 times, most recently from 7b5331d to 2db5584 Compare October 16, 2026 14:21
@matheusandre1
matheusandre1 marked this pull request as ready for review October 16, 2026 14:50
@matheusandre1
matheusandre1 requested review from a team as code owners October 16, 2026 14:50
Signed-off-by: Matheus André <matheusandr2@gmail.com>
@matheusandre1
matheusandre1 force-pushed the feat/dapr-container-spring-boot-defaults branch from 2db5584 to 6d93833 Compare October 19, 2026 19:50
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.79%. Comparing base (ae32b03) to head (6d93833).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1842      +/-   ##
============================================
+ Coverage     79.73%   79.79%   +0.06%     
- Complexity     2693     2720      +27     
============================================
  Files           268      271       +3     
  Lines          7948     8007      +59     
  Branches        844      853       +9     
============================================
+ Hits           6337     6389      +52     
- Misses         1255     1262       +7     
  Partials        356      356              

☔ View full report in Codecov by Harness.
📢 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.

@javier-aliaga
javier-aliaga merged commit 760f85a into dapr:master Oct 20, 2026
23 of 24 checks passed
@matheusandre1
matheusandre1 deleted the feat/dapr-container-spring-boot-defaults branch October 20, 2026 09:31
javier-aliaga pushed a commit that referenced this pull request Oct 20, 2026
)

(cherry picked from commit 760f85a)

Signed-off-by: Matheus André <matheusandr2@gmail.com>
Co-authored-by: Matheus André <92062874+matheusandre1@users.noreply.github.com>
@nelson-parente nelson-parente added this to the v1.19 milestone Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify DaprContainer with default values for Spring Boot apps

3 participants