dapr / java-sdk

Dapr SDK for Java
Apache License 2.0
262 stars 207 forks source link

Adding @ServiceConnection spring boot support with Testcontainers #1118

Closed salaboy closed 2 months ago

salaboy commented 2 months ago

Description

This PR implements the Testcontainers @ServiceConnection to simplify how applications can connect to DaprContainers. This PR also aligns Spring Boot dependencies to reduce the amount of dependencies that users need to add to their projects.

Issue reference

Fixes: #1117

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

artur-ciocanu commented 2 months ago

@salaboy could you please rebase your PR. Thank you!

salaboy commented 2 months ago

@artursouza @cicoyle this is the last PR to get the Documentation working with an example. Please review and I am happy to have a call if you want to make the review faster.

artur-ciocanu commented 2 months ago

@salaboy I have added a small comment, the issue with the build that you have faced is related to DaprClientProperties. You have two options:

Let me know your thoughts.

salaboy commented 2 months ago

@salaboy I have added a small comment, the issue with the build that you have faced is related to DaprClientProperties. You have two options:

  • Remove the constructor and leave the setters
  • Remove the setters and ensure that we preserve parameter names by leveraging the -parameter compiler flag. In order to preserver the parameter name you should add the <parameters>true</parameters> to Maven Compiler Plugin in the Parent POM. Something like this:
          <configuration>
            <source>${maven.compiler.source}</source>
            <target>${maven.compiler.target}</target>
            <release>${maven.compiler.release}</release>
            <parameters>true</parameters>
          </configuration>

Let me know your thoughts.

This is solved now