This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch CAMEL-16757b in repository https://gitbox.apache.org/repos/asf/camel.git
commit afbbb2ce56d033984ad0f1b0dc6ba3d2c0ead31d Author: Claus Ibsen <[email protected]> AuthorDate: Tue Aug 3 12:04:04 2021 +0200 CAMEL-16757: yaml dsl test with route-configuration-id --- .../camel/dsl/yaml/RouteConfigurationTest.groovy | 45 +++++++++++++--------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RouteConfigurationTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RouteConfigurationTest.groovy index fc347ff..15550bf 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RouteConfigurationTest.groovy +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RouteConfigurationTest.groovy @@ -16,16 +16,18 @@ */ package org.apache.camel.dsl.yaml +import org.apache.camel.Exchange import org.apache.camel.component.mock.MockEndpoint import org.apache.camel.dsl.yaml.support.YamlTestSupport import org.apache.camel.dsl.yaml.support.model.MyException import org.apache.camel.dsl.yaml.support.model.MyFailingProcessor +import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Disabled class RouteConfigurationTest extends YamlTestSupport { def "route-configuration"() { setup: - loadRoutes """ + loadRoutes """ - beans: - name: myFailingProcessor type: ${MyFailingProcessor.name} @@ -46,18 +48,18 @@ class RouteConfigurationTest extends YamlTestSupport { ref: "myFailingProcessor" """ - withMock('mock:on-exception') { - expectedBodiesReceived 'Sorry' - } + withMock('mock:on-exception') { + expectedBodiesReceived 'Sorry' + } when: - context.start() + context.start() - withTemplate { - to('direct:start').withBody('hello').send() - } + withTemplate { + to('direct:start').withBody('hello').send() + } then: - MockEndpoint.assertIsSatisfied(context) + MockEndpoint.assertIsSatisfied(context) } def "route-configuration-separate"() { @@ -107,8 +109,6 @@ class RouteConfigurationTest extends YamlTestSupport { MockEndpoint.assertIsSatisfied(context) } - // TODO: fix me - /* def "route-configuration-id"() { setup: // global configurations @@ -130,13 +130,16 @@ class RouteConfigurationTest extends YamlTestSupport { """ // routes loadRoutes """ - - from: - uri: "direct:start" + - route: + route-configuration-id: handleError + from: + uri: "direct:start" steps: - process: ref: "myFailingProcessor" - - from: - uri: "direct:start2" + - route: + from: + uri: "direct:start2" steps: - process: ref: "myFailingProcessor" @@ -149,12 +152,18 @@ class RouteConfigurationTest extends YamlTestSupport { when: context.start() + Exchange out1 + Exchange out2 withTemplate { - to('direct:start').withBody('hello').send() - to('direct:start2').withBody('hello2').send() + out1 = to('direct:start').withBody('hello').send() + out2 = to('direct:start2').withBody('hello2').send() } + then: MockEndpoint.assertIsSatisfied(context) - }*/ + + Assertions.assertFalse(out1.isFailed()) + Assertions.assertTrue(out2.isFailed()) + } }
