-
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.
Add configuration overrides for DaprWorkflowClient and WorkflowRuntim…
…eBuilder (#1113) Signed-off-by: Artur Ciocanu <ciocanu@adobe.com> Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
- Loading branch information
1 parent
935f3be
commit 702aa05
Showing
18 changed files
with
246 additions
and
131 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
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
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
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
42 changes: 0 additions & 42 deletions
42
sdk-tests/src/test/java/io/dapr/it/testcontainers/DaprTestcontainersModule.java
This file was deleted.
Oops, something went wrong.
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
51 changes: 51 additions & 0 deletions
51
sdk-tests/src/test/java/io/dapr/it/testcontainers/TestDaprWorkflowsConfiguration.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,51 @@ | ||
package io.dapr.it.testcontainers; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import io.dapr.config.Properties; | ||
import io.dapr.workflows.client.DaprWorkflowClient; | ||
import io.dapr.workflows.runtime.WorkflowRuntimeBuilder; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.Map; | ||
|
||
@Configuration | ||
public class TestDaprWorkflowsConfiguration { | ||
@Bean | ||
public ObjectMapper mapper() { | ||
return new ObjectMapper(); | ||
} | ||
|
||
@Bean | ||
public DaprWorkflowClient daprWorkflowClient( | ||
@Value("${dapr.http.endpoint}") String daprHttpEndpoint, | ||
@Value("${dapr.grpc.endpoint}") String daprGrpcEndpoint | ||
){ | ||
Map<String, String> overrides = Map.of( | ||
"dapr.http.endpoint", daprHttpEndpoint, | ||
"dapr.grpc.endpoint", daprGrpcEndpoint | ||
); | ||
|
||
return new DaprWorkflowClient(new Properties(overrides)); | ||
} | ||
|
||
@Bean | ||
public WorkflowRuntimeBuilder workflowRuntimeBuilder( | ||
@Value("${dapr.http.endpoint}") String daprHttpEndpoint, | ||
@Value("${dapr.grpc.endpoint}") String daprGrpcEndpoint | ||
){ | ||
Map<String, String> overrides = Map.of( | ||
"dapr.http.endpoint", daprHttpEndpoint, | ||
"dapr.grpc.endpoint", daprGrpcEndpoint | ||
); | ||
|
||
WorkflowRuntimeBuilder builder = new WorkflowRuntimeBuilder(new Properties(overrides)); | ||
|
||
builder.registerWorkflow(TestWorkflow.class); | ||
builder.registerActivity(FirstActivity.class); | ||
builder.registerActivity(SecondActivity.class); | ||
|
||
return builder; | ||
} | ||
} |
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
Oops, something went wrong.