1
+ /*
2
+ * Copyright 2025 The Dapr Authors
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS,
9
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ * See the License for the specific language governing permissions and
11
+ limitations under the License.
12
+ */
13
+
1
14
package io .dapr .testcontainers .converter ;
2
15
16
+ import io .dapr .testcontainers .AppHttpPipeline ;
3
17
import io .dapr .testcontainers .Configuration ;
4
18
import io .dapr .testcontainers .DaprContainer ;
19
+ import io .dapr .testcontainers .ListEntry ;
5
20
import io .dapr .testcontainers .OtelTracingConfigurationSettings ;
6
21
import io .dapr .testcontainers .TracingConfigurationSettings ;
7
22
import org .junit .jupiter .api .Test ;
10
25
import static org .junit .jupiter .api .Assertions .assertEquals ;
11
26
import static org .junit .jupiter .api .Assertions .assertNotNull ;
12
27
28
+ import java .util .ArrayList ;
29
+ import java .util .List ;
30
+
13
31
class ConfigurationYamlConverterTest {
14
32
private final Yaml MAPPER = YamlMapperFactory .create ();
15
33
private final ConfigurationYamlConverter converter = new ConfigurationYamlConverter (MAPPER );
@@ -28,10 +46,16 @@ public void testConfigurationToYaml() {
28
46
null
29
47
);
30
48
49
+
50
+ List <ListEntry > handlers = new ArrayList <>();
51
+ handlers .add (new ListEntry ("alias" , "middleware.http.routeralias" ));
52
+
53
+ AppHttpPipeline appHttpPipeline = new AppHttpPipeline (handlers );
54
+
31
55
DaprContainer dapr = new DaprContainer ("daprio/daprd" )
32
56
.withAppName ("dapr-app" )
33
57
.withAppPort (8081 )
34
- .withConfiguration (new Configuration ("my-config" , tracing ))
58
+ .withConfiguration (new Configuration ("my-config" , tracing , appHttpPipeline ))
35
59
.withAppChannelAddress ("host.testcontainers.internal" );
36
60
37
61
Configuration configuration = dapr .getConfiguration ();
@@ -50,7 +74,11 @@ public void testConfigurationToYaml() {
50
74
+ " otel:\n "
51
75
+ " endpointAddress: localhost:4317\n "
52
76
+ " isSecure: false\n "
53
- + " protocol: grpc\n " ;
77
+ + " protocol: grpc\n "
78
+ + " appHttpPipeline:\n "
79
+ + " handlers:\n "
80
+ + " - name: alias\n "
81
+ + " type: middleware.http.routeralias\n " ;
54
82
55
83
assertEquals (expectedConfigurationYaml , configurationYaml );
56
84
}
0 commit comments