Skip to content

Commit d25c2f1

Browse files
mcruzdevartur-ciocanucicoyle
authored andcommitted
Use camelCase on properties (dapr#1470)
* Use camelCase on properties Signed-off-by: Matheus Cruz <[email protected]> * Add test for cameCalse properties Signed-off-by: Matheus Cruz <[email protected]> * Update daprdocs/content/en/java-sdk-docs/spring-boot/_index.md Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: Matheus Cruz <[email protected]> --------- Signed-off-by: Matheus Cruz <[email protected]> Signed-off-by: Matheus Cruz <[email protected]> Co-authored-by: artur-ciocanu <[email protected]> Co-authored-by: Cassie Coyle <[email protected]>
1 parent e5b83b5 commit d25c2f1

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

dapr-spring/dapr-spring-boot-autoconfigure/src/test/java/io/dapr/spring/boot/autoconfigure/client/DaprClientPropertiesTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,26 @@ public void shouldMapDaprClientProperties() {
8383
});
8484

8585
});
86+
}
8687

88+
@Test
89+
@DisplayName("Should map DaprClient properties correctly (camelCase)")
90+
public void shouldMapDaprClientPropertiesCamelCase() {
91+
runner.withSystemProperties(
92+
"dapr.client.httpEndpoint=http://localhost",
93+
"dapr.client.httpPort=3500",
94+
"dapr.client.grpcEndpoint=localhost",
95+
"dapr.client.grpcPort=50001"
96+
).run(context -> {
97+
DaprClientProperties properties = context.getBean(DaprClientProperties.class);
98+
SoftAssertions.assertSoftly(softly -> {
99+
softly.assertThat(properties.getGrpcEndpoint()).isEqualTo("localhost");
100+
softly.assertThat(properties.getHttpEndpoint()).isEqualTo("http://localhost");
101+
softly.assertThat(properties.getHttpPort()).isEqualTo(3500);
102+
softly.assertThat(properties.getGrpcPort()).isEqualTo(50001);
103+
});
104+
105+
});
87106
}
88107

89108
@EnableConfigurationProperties(DaprClientProperties.class)

daprdocs/content/en/java-sdk-docs/spring-boot/_index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ This will connect to the default Dapr gRPC endpoint `localhost:50001`, requiring
5656
{{% alert title="Note" color="primary" %}}
5757
By default, the following properties are preconfigured for `DaprClient` and `DaprWorkflowClient`:
5858
```properties
59-
dapr.client.http-endpoint=http://localhost
60-
dapr.client.http-port=3500
61-
dapr.client.grpc-endpoint=localhost
62-
dapr.client.grpc-port=50001
63-
dapr.client.api-token=<Your Remote App API Token>
59+
dapr.client.httpEndpoint=http://localhost
60+
dapr.client.httpPort=3500
61+
dapr.client.grpcEndpoint=localhost
62+
dapr.client.grpcPort=50001
63+
dapr.client.apiToken=<your remote api token>
6464
```
65-
These values are used by default, but you can override them in your `application.properties` file to suit your environment.
65+
These values are used by default, but you can override them in your `application.properties` file to suit your environment. Please note that both kebab case and camel case are supported.
6666
{{% /alert %}}
6767

6868
You can use the `DaprClient` to interact with the Dapr APIs anywhere in your application, for example from inside a REST endpoint:

0 commit comments

Comments
 (0)