test: Add test for kamel bind command with step properties
Refs:
@@ -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)
+}
