Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

@ConfigurationProperties(prefix = "dapr.client")
public class DaprClientProperties {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wondering if an endpoints shouldn't have the port. As far as I remember there is some parsing logic in the network utils.

private String httpEndpoint;
private String grpcEndpoint;
private Integer httpPort;
private Integer grpcPort;
private String httpEndpoint = "http://localhost";
private String grpcEndpoint = "localhost";
private Integer httpPort = 3500;
private Integer grpcPort = 50001;
private String apiToken;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ public void shouldSetDaprClientPropertiesCorrectly() {
});
}

@Test
@DisplayName("Should create DaprClientProperties default values correctly")
public void shouldSetDaprClientDefaultPropertiesCorrectly() {

DaprClientProperties properties = new DaprClientProperties();

SoftAssertions.assertSoftly(softAssertions -> {
softAssertions.assertThat(properties.getGrpcEndpoint()).isEqualTo("localhost");
softAssertions.assertThat(properties.getHttpEndpoint()).isEqualTo("http://localhost");
softAssertions.assertThat(properties.getHttpPort()).isEqualTo(3500);
softAssertions.assertThat(properties.getGrpcPort()).isEqualTo(50001);
softAssertions.assertThat(properties.getApiToken()).isNull();
});
}

@Test
@DisplayName("Should map DaprClient properties correctly")
public void shouldMapDaprClientProperties() {
Expand Down Expand Up @@ -105,6 +120,8 @@ public void shouldMapDaprClientPropertiesCamelCase() {
});
}

Copy link
Contributor

Choose a reason for hiding this comment

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

We could remove unnecessary new lines.



@EnableConfigurationProperties(DaprClientProperties.class)
static class EnableDaprClientProperties {

Expand Down
Loading