File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
main/java/io/dapr/testcontainers
test/java/io/dapr/testcontainers Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -65,12 +65,14 @@ public WorkflowDashboardContainer(String image) {
6565 @ Override
6666 protected void configure () {
6767 super .configure ();
68- if (stateStoreComponent != null ) {
69- String componentYaml = COMPONENT_CONVERTER .convert (stateStoreComponent );
70- withCopyToContainer (Transferable .of (componentYaml ), "/app/components/" + stateStoreComponent .getName () + ".yaml" );
71- withEnv ("COMPONENT_FILE" , "/app/components/" + stateStoreComponent .getName () + ".yaml" );
68+ if (stateStoreComponent == null ) {
69+ throw new IllegalStateException ("State store component cannot be null" );
7270 }
7371
72+ String componentYaml = COMPONENT_CONVERTER .convert (stateStoreComponent );
73+ withCopyToContainer (Transferable .of (componentYaml ), "/app/components/" + stateStoreComponent .getName () + ".yaml" );
74+ withEnv ("COMPONENT_FILE" , "/app/components/" + stateStoreComponent .getName () + ".yaml" );
75+
7476 }
7577
7678 public static DockerImageName getDefaultImageName () {
Original file line number Diff line number Diff line change @@ -38,6 +38,20 @@ public void dashboardTest() {
3838 assertEquals (WorkflowDashboardContainer .DEFAULT_IMAGE_NAME , dashboard .getDefaultImageName ());
3939 assertEquals (8080 , dashboard .getExposedPorts ().get (0 ));
4040 assertEquals (stateStoreComponent , dashboard .getStateStoreComponent ());
41+ assertEquals ("/app/components/kvstore.yaml" , dashboard .getEnvMap ().get ("COMPONENT_FILE" ));
4142 }
4243 }
44+
45+ @ Test
46+ public void dashboardNoStateStoreTest () {
47+ Exception expectedException = null ;
48+ try {
49+ WorkflowDashboardContainer dashboard =
50+ new WorkflowDashboardContainer (WorkflowDashboardContainer .DEFAULT_IMAGE_NAME );
51+ dashboard .configure ();
52+ } catch (IllegalStateException ex ){
53+ expectedException = ex ;
54+ }
55+ assertNotNull (expectedException );
56+ }
4357}
You can’t perform that action at this time.
0 commit comments