Skip to content

Commit 7ca52aa

Browse files
committed
Add extra test for variables.
1 parent 220b321 commit 7ca52aa

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

internal/pkg/agent/application/application_test.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,40 @@ func TestInjectOutputOverrides(t *testing.T) {
254254
},
255255
},
256256
},
257+
{
258+
Name: "setting variables are not expanded",
259+
RawConfig: map[string]any{
260+
"outputs": map[string]any{
261+
"default": map[string]any{
262+
"type": "elasticsearch",
263+
"headers": map[string]any{
264+
"X-App-Auth": "${filesource.app_token}",
265+
},
266+
},
267+
},
268+
},
269+
ChangeConfig: map[string]any{
270+
"outputs": map[string]any{
271+
"default": map[string]any{
272+
"type": "kafka",
273+
"headers": map[string]any{
274+
"X-App-Other": "${filesource.other_token}",
275+
},
276+
},
277+
},
278+
},
279+
Result: map[string]any{
280+
"outputs": map[string]any{
281+
"default": map[string]any{
282+
"type": "kafka",
283+
"headers": map[string]any{
284+
"X-App-Auth": "${filesource.app_token}",
285+
"X-App-Other": "${filesource.other_token}",
286+
},
287+
},
288+
},
289+
},
290+
},
257291
}
258292
for _, scenario := range scenarios {
259293
t.Run(scenario.Name, func(t *testing.T) {

0 commit comments

Comments
 (0)