-
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.
Signed-off-by: salaboy <Salaboy@gmail.com>
- Loading branch information
Showing
10 changed files
with
145 additions
and
106 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
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.
7 changes: 7 additions & 0 deletions
7
...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,7 @@ | ||
package io.dapr.spring.boot.autoconfigure.client; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
@ConfigurationProperties(prefix = "dapr.client") | ||
public record DaprClientProperties(String httpEndpoint, String grpcEndpoint, Integer httpPort, Integer grpcPort) { | ||
} |
11 changes: 11 additions & 0 deletions
11
...nfigure/src/main/java/io/dapr/spring/boot/autoconfigure/client/DaprConnectionDetails.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,11 @@ | ||
package io.dapr.spring.boot.autoconfigure.client; | ||
|
||
|
||
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails; | ||
|
||
public interface DaprConnectionDetails extends ConnectionDetails { | ||
String httpEndpoint(); | ||
String grpcEndpoint(); | ||
Integer httpPort(); | ||
Integer grcpPort(); | ||
} |
30 changes: 30 additions & 0 deletions
30
...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,30 @@ | ||
package io.dapr.spring.boot.autoconfigure.client; | ||
|
||
public class PropertiesDaprConnectionDetails implements DaprConnectionDetails { | ||
|
||
private final DaprClientProperties daprClientProperties; | ||
|
||
public PropertiesDaprConnectionDetails(DaprClientProperties daprClientProperties) { | ||
this.daprClientProperties = daprClientProperties; | ||
} | ||
|
||
@Override | ||
public String httpEndpoint() { | ||
return this.daprClientProperties.httpEndpoint(); | ||
} | ||
|
||
@Override | ||
public String grpcEndpoint() { | ||
return this.daprClientProperties.grpcEndpoint(); | ||
} | ||
|
||
@Override | ||
public Integer httpPort() { | ||
return this.daprClientProperties.httpPort(); | ||
} | ||
|
||
@Override | ||
public Integer grcpPort() { | ||
return this.daprClientProperties.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
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,45 @@ | ||
<?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> | ||
</parent> | ||
|
||
<artifactId>dapr-spring-boot-tests</artifactId> | ||
<name>dapr-spring-boot-tests</name> | ||
<description>Dapr Spring Boot Tests</description> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-testcontainers</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.dapr.spring</groupId> | ||
<artifactId>dapr-spring-boot-autoconfigure</artifactId> | ||
<version>${project.parent.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>com.vaadin.external.google</groupId> | ||
<artifactId>android-json</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.dapr</groupId> | ||
<artifactId>testcontainers-dapr</artifactId> | ||
<version>${dapr.sdk.alpha.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
39 changes: 39 additions & 0 deletions
39
...-tests/src/main/java/io/dapr/spring/boot/tests/DaprContainerConnectionDetailsFactory.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,39 @@ | ||
package io.dapr.spring.boot.tests; | ||
|
||
import io.dapr.spring.boot.autoconfigure.client.DaprConnectionDetails; | ||
import io.dapr.testcontainers.DaprContainer; | ||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory; | ||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource; | ||
|
||
public class DaprContainerConnectionDetailsFactory extends ContainerConnectionDetailsFactory<DaprContainer, DaprConnectionDetails> { | ||
DaprContainerConnectionDetailsFactory() { | ||
} | ||
protected DaprConnectionDetails getContainerConnectionDetails(ContainerConnectionSource<DaprContainer> source) { | ||
return new DaprContainerConnectionDetails(source); | ||
} | ||
private static final class DaprContainerConnectionDetails extends ContainerConnectionDetailsFactory.ContainerConnectionDetails<DaprContainer> implements DaprConnectionDetails { | ||
private DaprContainerConnectionDetails(ContainerConnectionSource<DaprContainer> source) { | ||
super(source); | ||
} | ||
|
||
@Override | ||
public String httpEndpoint() { | ||
return getContainer().getHttpEndpoint(); | ||
} | ||
|
||
@Override | ||
public String grpcEndpoint() { | ||
return getContainer().getGrpcEndpoint(); | ||
} | ||
|
||
@Override | ||
public Integer httpPort() { | ||
return getContainer().getHttpPort(); | ||
} | ||
|
||
@Override | ||
public Integer grcpPort() { | ||
return getContainer().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
40 changes: 0 additions & 40 deletions
40
...tainers-dapr/src/main/java/io/dapr/testcontainers/TestcontainersDaprClientCustomizer.java
This file was deleted.
Oops, something went wrong.