This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit e4cc09eeeaf71c3f32c5ef811519c326d6e53f58 Author: Gaelle Fournier <[email protected]> AuthorDate: Thu Dec 8 10:53:39 2022 +0100 test: Add test for kamel bind command with step properties Refs: #2586 --- pkg/cmd/bind_test.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/pkg/cmd/bind_test.go b/pkg/cmd/bind_test.go index e4583b7bd..9d263b784 100644 --- a/pkg/cmd/bind_test.go +++ b/pkg/cmd/bind_test.go @@ -201,3 +201,37 @@ spec: status: {} `, output) } + +func TestBindSteps(t *testing.T) { + buildCmdOptions, bindCmd, _ := initializeBindCmdOptions(t) + output, err := test.ExecuteCommand(bindCmd, cmdBind, "my:src", "my:dst", "-o", "yaml", + "--step", "dst:step1", "--step", "src:step2", + "-p", "step-0.var1=my-step1-var1", "-p", "step-0.var2=my-step1-var2", + "-p", "step-1.var1=my-step2-var1", "-p", "step-1.var2=my-step2-var2") + assert.Equal(t, "yaml", buildCmdOptions.OutputFormat) + + assert.Nil(t, err) + assert.Equal(t, `apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + annotations: + camel.apache.org/operator.id: camel-k + creationTimestamp: null + name: my-to-my +spec: + sink: + uri: my:dst + source: + uri: my:src + steps: + - properties: + var1: my-step1-var1 + var2: my-step1-var2 + uri: dst:step1 + - properties: + var1: my-step2-var1 + var2: my-step2-var2 + uri: src:step2 +status: {} +`, output) +}
