This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 4eaa87f8c90174388971ed275a2520ce082d9b72 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Feb 17 18:52:12 2023 +0100 camel-yaml-dsl - Added unit test --- .../org/apache/camel/dsl/yaml/LocationTest.groovy | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/LocationTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/LocationTest.groovy new file mode 100644 index 00000000000..bb8de2b836e --- /dev/null +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/LocationTest.groovy @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.dsl.yaml + +import org.apache.camel.dsl.yaml.support.YamlTestSupport +import org.apache.camel.model.FromDefinition +import org.apache.camel.model.LogDefinition + +class LocationTest extends YamlTestSupport { + + def "location"() { + when: + loadRoutes ''' + - from: + uri: "direct:start" + steps: + - log: "${body}" + ''' + then: + context.routeDefinitions.size() == 1 + + with(context.routeDefinitions[0].input, FromDefinition) { + location == "route-0.yaml" + lineNumber == 2 + } + + with(context.routeDefinitions[0].outputs[0], LogDefinition) { + location == "route-0.yaml" + lineNumber == 5 + } + } + +}