-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding @Serviceconnection spring boot support with Testcontainers (#1118
) * adding service connection plumbing Signed-off-by: salaboy <Salaboy@gmail.com> * fixing style Signed-off-by: salaboy <Salaboy@gmail.com> * updating sdk-tests Signed-off-by: salaboy <Salaboy@gmail.com> * Update dapr-spring/dapr-spring-boot-autoconfigure/src/main/java/io/dapr/spring/boot/autoconfigure/client/DaprClientAutoConfiguration.java Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com> Signed-off-by: salaboy <Salaboy@gmail.com> * Update dapr-spring/dapr-spring-boot-autoconfigure/src/main/java/io/dapr/spring/boot/autoconfigure/client/PropertiesDaprConnectionDetails.java Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com> Signed-off-by: salaboy <Salaboy@gmail.com> * fixing details Signed-off-by: salaboy <Salaboy@gmail.com> * adding @Serviceconnection to Dapr Signed-off-by: salaboy <Salaboy@gmail.com> * fixing tests and style Signed-off-by: salaboy <Salaboy@gmail.com> * removing test that is not needed anymore Signed-off-by: salaboy <Salaboy@gmail.com> * updating starter dependencies Signed-off-by: salaboy <Salaboy@gmail.com> * adding juniper testcontainers support Signed-off-by: salaboy <Salaboy@gmail.com> * adding new testing module Signed-off-by: salaboy <Salaboy@gmail.com> * cleaning sdk-tests deps Signed-off-by: salaboy <Salaboy@gmail.com> * removing dead code Signed-off-by: salaboy <Salaboy@gmail.com> * removing core that is not needed Signed-off-by: salaboy <Salaboy@gmail.com> * adding setters Signed-off-by: salaboy <Salaboy@gmail.com> * default constructor Signed-off-by: salaboy <Salaboy@gmail.com> --------- Signed-off-by: salaboy <Salaboy@gmail.com> Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com>
- Loading branch information
1 parent
9b927c8
commit 4b83da6
Showing
24 changed files
with
312 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
...e/src/main/java/io/dapr/spring/boot/autoconfigure/client/DaprClientBuilderConfigurer.java
This file was deleted.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
...onfigure/src/main/java/io/dapr/spring/boot/autoconfigure/client/DaprClientProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright 2024 The Dapr Authors | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package io.dapr.spring.boot.autoconfigure.client; | ||
|
||
import io.dapr.spring.data.DaprKeyValueAdapterResolver; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
@ConfigurationProperties(prefix = "dapr.client") | ||
public class DaprClientProperties { | ||
private String httpEndpoint; | ||
private String grpcEndpoint; | ||
private Integer httpPort; | ||
private Integer grpcPort; | ||
|
||
|
||
/** | ||
* Constructs a {@link DaprClientProperties}. | ||
*/ | ||
public DaprClientProperties() { | ||
} | ||
|
||
/** | ||
* Constructs a {@link DaprClientProperties}. | ||
* @param httpEndpoint http endpoint to interact with the Dapr Sidecar | ||
* @param grpcEndpoint grpc endpoint to interact with the Dapr Sidecar | ||
* @param httpPort http port to interact with the Dapr Sidecar | ||
* @param grpcPort grpc port to interact with the Dapr Sidecar | ||
*/ | ||
public DaprClientProperties(String httpEndpoint, String grpcEndpoint, Integer httpPort, Integer grpcPort) { | ||
this.httpEndpoint = httpEndpoint; | ||
this.grpcEndpoint = grpcEndpoint; | ||
this.httpPort = httpPort; | ||
this.grpcPort = grpcPort; | ||
} | ||
|
||
public String getHttpEndpoint() { | ||
return httpEndpoint; | ||
} | ||
|
||
public String getGrpcEndpoint() { | ||
return grpcEndpoint; | ||
} | ||
|
||
public Integer getHttpPort() { | ||
return httpPort; | ||
} | ||
|
||
public Integer getGrpcPort() { | ||
return grpcPort; | ||
} | ||
|
||
public void setHttpEndpoint(String httpEndpoint) { | ||
this.httpEndpoint = httpEndpoint; | ||
} | ||
|
||
public void setGrpcEndpoint(String grpcEndpoint) { | ||
this.grpcEndpoint = grpcEndpoint; | ||
} | ||
|
||
public void setHttpPort(Integer httpPort) { | ||
this.httpPort = httpPort; | ||
} | ||
|
||
public void setGrpcPort(Integer grpcPort) { | ||
this.grpcPort = grpcPort; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...c/main/java/io/dapr/spring/boot/autoconfigure/client/PropertiesDaprConnectionDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2024 The Dapr Authors | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package io.dapr.spring.boot.autoconfigure.client; | ||
|
||
class PropertiesDaprConnectionDetails implements DaprConnectionDetails { | ||
|
||
private final DaprClientProperties daprClientProperties; | ||
|
||
public PropertiesDaprConnectionDetails(DaprClientProperties daprClientProperties) { | ||
this.daprClientProperties = daprClientProperties; | ||
} | ||
|
||
@Override | ||
public String httpEndpoint() { | ||
return this.daprClientProperties.getHttpEndpoint(); | ||
} | ||
|
||
@Override | ||
public String grpcEndpoint() { | ||
return this.daprClientProperties.getGrpcEndpoint(); | ||
} | ||
|
||
@Override | ||
public Integer httpPort() { | ||
return this.daprClientProperties.getHttpPort(); | ||
} | ||
|
||
@Override | ||
public Integer grpcPort() { | ||
return this.daprClientProperties.getGrpcPort(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
dapr-spring/dapr-spring-boot-starters/dapr-spring-boot-starter-test/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.dapr.spring</groupId> | ||
<artifactId>dapr-spring-parent</artifactId> | ||
<version>0.13.0-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>dapr-spring-boot-starter-test</artifactId> | ||
<name>dapr-spring-boot-starter-test</name> | ||
<description>Dapr Spring Boot Starter Tests (with Testcontainers Support)</description> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.dapr.spring</groupId> | ||
<artifactId>dapr-spring-boot-tests</artifactId> | ||
<version>${project.parent.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.dapr</groupId> | ||
<artifactId>testcontainers-dapr</artifactId> | ||
<version>${project.parent.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-testcontainers</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.