Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1f08776
initial workflow dashboard config
salaboy Dec 4, 2025
c654553
adding test for dashboard container
salaboy Dec 5, 2025
1c7e5e7
adding URL to output
salaboy Dec 5, 2025
3b73edf
Adding a Flux based subscribeToEvents method (#1598)
artur-ciocanu Dec 5, 2025
787edfc
fixing configure()
salaboy Dec 5, 2025
d8f2810
Remove SDK docs due to migration to main Docs repo (#1593)
marcduiker Dec 5, 2025
b4baa1f
fixing headers
salaboy Dec 10, 2025
4399d30
codecov token and new image
salaboy Dec 10, 2025
0b406ae
Update testcontainers-dapr/src/main/java/io/dapr/testcontainers/Workf…
salaboy Jan 5, 2026
ce544d3
Update testcontainers-dapr/src/main/java/io/dapr/testcontainers/Workf…
salaboy Jan 5, 2026
c26fddf
Bringing Durable Task Java as a Maven module inside the Java SDK (#1575)
salaboy Dec 13, 2025
8f4fa61
Bump codecov/codecov-action from 5.5.1 to 5.5.2 (#1607)
dependabot[bot] Dec 16, 2025
3ab0009
Create Dapr WaitStrategy to improve ITs ergonomics (#1609)
artur-ciocanu Jan 3, 2026
78af4a3
Bump actions/upload-artifact from 4 to 6 (#1606)
dependabot[bot] Jan 3, 2026
0dd4f59
Jobs promotion to DaprClient (#1602)
salaboy Jan 5, 2026
6862ec6
Add Cryptography APIs to the Java SDK (#1599)
siri-varma Jan 6, 2026
80eb395
Adding DaprSpringBootTest and DaprSidecarContainer annotation for eas…
artur-ciocanu Jan 6, 2026
3ae7ab1
adding constant for dashboard
salaboy Jan 7, 2026
ea78b8d
extend test for codecov
salaboy Jan 7, 2026
c81ac16
adding tests for null state store
salaboy Jan 7, 2026
572fb41
testing string constructor
salaboy Jan 7, 2026
816edbd
Merge branch 'master' into workflow-dashboard
salaboy Jan 7, 2026
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
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
run: ./mvnw clean install -B -q -DskipITs=true
- name: Codecov
uses: codecov/codecov-action@v5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test report for sdk
uses: actions/upload-artifact@v6
with:
Expand Down
6 changes: 6 additions & 0 deletions spring-boot-examples/workflows/patterns/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
<artifactId>microcks-testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-postgresql</artifactId>
<version>2.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@

package io.dapr.springboot.examples.wfp;


import io.dapr.testcontainers.Component;
import io.dapr.testcontainers.DaprContainer;
import io.dapr.testcontainers.DaprLogLevel;
import io.dapr.testcontainers.WorkflowDashboardContainer;
import io.github.microcks.testcontainers.MicrocksContainersEnsemble;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
Expand All @@ -26,9 +27,12 @@
import org.springframework.test.context.DynamicPropertyRegistrar;
import org.testcontainers.DockerClientFactory;
import org.testcontainers.containers.Network;
import org.testcontainers.postgresql.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static io.dapr.testcontainers.DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG;

Expand All @@ -45,19 +49,44 @@
@TestConfiguration(proxyBeanMethods = false)
public class DaprTestContainersConfig {

Map<String, String> postgreSQLDetails = new HashMap<>();

{{
postgreSQLDetails.put("host", "postgresql");
postgreSQLDetails.put("user", "postgres");
postgreSQLDetails.put("password", "postgres");
postgreSQLDetails.put("database", "dapr");
postgreSQLDetails.put("port", "5432");
postgreSQLDetails.put("actorStateStore", String.valueOf(true));

}}

private Component stateStoreComponent = new Component("kvstore",
"state.postgresql", "v2", postgreSQLDetails);

@Bean
@ServiceConnection
public DaprContainer daprContainer(Network network) {
public DaprContainer daprContainer(Network network, PostgreSQLContainer postgreSQLContainer) {

return new DaprContainer(DAPR_RUNTIME_IMAGE_TAG)
.withAppName("workflow-patterns-app")
.withComponent(new Component("kvstore", "state.in-memory", "v1", Collections.singletonMap("actorStateStore", String.valueOf(true))))
.withComponent(stateStoreComponent)
.withAppPort(8080)
.withNetwork(network)
.withAppHealthCheckPath("/actuator/health")
.withAppChannelAddress("host.testcontainers.internal");
.withAppChannelAddress("host.testcontainers.internal")
.dependsOn(postgreSQLContainer);
}

@Bean
public PostgreSQLContainer postgreSQLContainer(Network network) {
return new PostgreSQLContainer(DockerImageName.parse("postgres"))
.withNetworkAliases("postgresql")
.withDatabaseName("dapr")
.withUsername("postgres")
.withPassword("postgres")
.withNetwork(network);
}

@Bean
MicrocksContainersEnsemble microcksEnsemble(Network network) {
Expand All @@ -66,6 +95,14 @@ MicrocksContainersEnsemble microcksEnsemble(Network network) {
.withMainArtifacts("third-parties/remote-http-service.yaml");
}

@Bean
public WorkflowDashboardContainer workflowDashboard(Network network) {
return new WorkflowDashboardContainer(WorkflowDashboardContainer.getDefaultImageName())
.withNetwork(network)
.withStateStoreComponent(stateStoreComponent)
.withExposedPorts(8080);
}

@Bean
public DynamicPropertyRegistrar endpointsProperties(MicrocksContainersEnsemble ensemble) {
// We need to replace the default endpoints with those provided by Microcks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

public interface DaprContainerConstants {
String DAPR_VERSION = "1.16.0-rc.5";
String DAPR_WORKFLOWS_DASHBOARD_VERSION = "0.0.1";
String DAPR_RUNTIME_IMAGE_TAG = "daprio/daprd:" + DAPR_VERSION;
String DAPR_PLACEMENT_IMAGE_TAG = "daprio/placement:" + DAPR_VERSION;
String DAPR_SCHEDULER_IMAGE_TAG = "daprio/scheduler:" + DAPR_VERSION;
String DAPR_WORKFLOWS_DASHBOARD = "ghcr.io/diagridio/diagrid-dashboard:" + DAPR_WORKFLOWS_DASHBOARD_VERSION;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
* Copyright 2025 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.testcontainers;

import io.dapr.testcontainers.converter.ComponentYamlConverter;
import io.dapr.testcontainers.converter.YamlConverter;
import io.dapr.testcontainers.converter.YamlMapperFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.images.builder.Transferable;
import org.testcontainers.utility.DockerImageName;
import org.yaml.snakeyaml.Yaml;

/**
* Test container for Dapr Workflow Dashboard.
*/
public class WorkflowDashboardContainer extends GenericContainer<WorkflowDashboardContainer> {
private static final Logger LOGGER = LoggerFactory.getLogger(WorkflowDashboardContainer.class);
private static final Yaml YAML_MAPPER = YamlMapperFactory.create();
private static final YamlConverter<Component> COMPONENT_CONVERTER = new ComponentYamlConverter(YAML_MAPPER);
public static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName
.parse(DaprContainerConstants.DAPR_WORKFLOWS_DASHBOARD);
private int dashboardPort = 8080;
private Component stateStoreComponent;

/**
* Creates a new workflow dashboard container.
* @param dockerImageName Docker image name.
*/
public WorkflowDashboardContainer(DockerImageName dockerImageName) {
super(dockerImageName);
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
withExposedPorts(dashboardPort);
}

public WorkflowDashboardContainer withStateStoreComponent(Component stateStoreComponent) {
this.stateStoreComponent = stateStoreComponent;
return this;
}

public Component getStateStoreComponent() {
return stateStoreComponent;
}

/**
* Creates a new workflow dashboard container.
* @param image Docker image name.
*/
public WorkflowDashboardContainer(String image) {
this(DockerImageName.parse(image));
}

@Override
protected void configure() {
super.configure();
if (stateStoreComponent == null) {
throw new IllegalStateException("State store component cannot be null");
}

String componentYaml = COMPONENT_CONVERTER.convert(stateStoreComponent);
withCopyToContainer(Transferable.of(componentYaml), "/app/components/" + stateStoreComponent.getName() + ".yaml");
withEnv("COMPONENT_FILE", "/app/components/" + stateStoreComponent.getName() + ".yaml");

}

public static DockerImageName getDefaultImageName() {
return DEFAULT_IMAGE_NAME;
}

public WorkflowDashboardContainer withPort(Integer port) {
this.dashboardPort = port;
return this;
}

@Override
public void start() {
super.start();

LOGGER.info("Dapr Workflow Dashboard container started.");
LOGGER.info("Access the Dashboard at: http://localhost:{}", this.getMappedPort(dashboardPort));
}

public int getPort() {
return dashboardPort;
}

// Required by spotbugs plugin
@Override
public boolean equals(Object o) {
return super.equals(o);
}

@Override
public int hashCode() {
return super.hashCode();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright 2025 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.testcontainers;

import org.junit.jupiter.api.Test;

import java.util.Collections;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class DaprWorkflowDashboardTest {

@Test
public void dashboardTest() {
Component stateStoreComponent = new Component("kvstore",
"state.in-memory", "v1", Collections.singletonMap("actorStateStore", "true"));
try (WorkflowDashboardContainer dashboard =
new WorkflowDashboardContainer(WorkflowDashboardContainer.DEFAULT_IMAGE_NAME)
.withStateStoreComponent(stateStoreComponent).withPort(8080)) {
dashboard.configure();
assertNotNull(dashboard.getEnvMap().get("COMPONENT_FILE"));
assertFalse(dashboard.getEnvMap().get("COMPONENT_FILE").isEmpty());
assertEquals(8080, dashboard.getPort());
assertEquals(WorkflowDashboardContainer.DEFAULT_IMAGE_NAME, dashboard.getDefaultImageName());
assertEquals(8080, dashboard.getExposedPorts().get(0));
assertEquals(stateStoreComponent, dashboard.getStateStoreComponent());
assertEquals("/app/components/kvstore.yaml", dashboard.getEnvMap().get("COMPONENT_FILE"));
}
}

@Test
public void dashboardNoStateStoreTest() {
Exception expectedException = null;
try{
WorkflowDashboardContainer dashboard =
new WorkflowDashboardContainer(WorkflowDashboardContainer.DEFAULT_IMAGE_NAME);
dashboard.configure();
} catch(IllegalStateException ex){
expectedException = ex;
}
assertNotNull(expectedException);
}

@Test
public void dashboardWithImageStringTest() {
Component stateStoreComponent = new Component("kvstore",
"state.in-memory", "v1", Collections.singletonMap("actorStateStore", "true"));
WorkflowDashboardContainer dashboard =
new WorkflowDashboardContainer(DaprContainerConstants.DAPR_WORKFLOWS_DASHBOARD)
.withStateStoreComponent(stateStoreComponent);
dashboard.configure();

assertEquals(WorkflowDashboardContainer.DEFAULT_IMAGE_NAME, dashboard.getDefaultImageName());

}
}
Loading