Skip to content

Commit 45ca0b6

Browse files
committed
adding test for dashboard container
1 parent b626647 commit 45ca0b6

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

testcontainers-dapr/src/main/java/io/dapr/testcontainers/WorkflowDashboardContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class WorkflowDashboardContainer extends GenericContainer<WorkflowDashboa
2828

2929
private static final Yaml YAML_MAPPER = YamlMapperFactory.create();
3030
private static final YamlConverter<Component> COMPONENT_CONVERTER = new ComponentYamlConverter(YAML_MAPPER);
31-
private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName
31+
public static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName
3232
.parse("public.ecr.aws/diagrid-dev/diagrid-dashboard:latest");
3333
private int dashboardPort = 8080;
3434
private Component stateStoreComponent;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package io.dapr.testcontainers;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import java.util.Collections;
6+
7+
import static org.junit.jupiter.api.Assertions.assertFalse;
8+
import static org.junit.jupiter.api.Assertions.assertNotNull;
9+
import static org.junit.jupiter.api.Assertions.assertTrue;
10+
11+
public class DaprWorkflowDashboardTest {
12+
13+
@Test
14+
public void dashboardTest() {
15+
Component stateStoreComponent = new Component("kvstore",
16+
"state.in-memory", "v1", Collections.singletonMap("actorStateStore", "true"));
17+
try (WorkflowDashboardContainer dashboard =
18+
new WorkflowDashboardContainer(WorkflowDashboardContainer.DEFAULT_IMAGE_NAME)
19+
.withStateStoreComponent(stateStoreComponent)) {
20+
dashboard.configure();
21+
assertNotNull(dashboard.getEnvMap().get("COMPONENT_FILE"));
22+
assertFalse(dashboard.getEnvMap().get("COMPONENT_FILE").isEmpty());
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)