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-karaf.git
The following commit(s) were added to refs/heads/main by this push:
new cb2cf71 CAMEL-17675: camel-core - Rest DSL remove support for using
inlined routes.
cb2cf71 is described below
commit cb2cf7104b03190c4e8ea5866c1e249ca8ed6331
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Feb 22 17:22:57 2022 +0100
CAMEL-17675: camel-core - Rest DSL remove support for using inlined routes.
---
.../component/rest/FromRestGetInterceptTest.java | 2 +-
.../component/rest/FromRestGetInterceptTest.xml | 35 +++++++------
.../component/rest/FromRestGetOnExceptionTest.xml | 57 ++++++++++++----------
.../rest/FromRestGetRouteOnExceptionTest.xml | 49 ++++++++++---------
4 files changed, 76 insertions(+), 67 deletions(-)
diff --git
a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.java
b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.java
index 2b5948d..11fba72 100644
---
a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.java
+++
b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.java
@@ -30,7 +30,7 @@ public class FromRestGetInterceptTest extends
CamelBlueprintTestSupport {
public void testFromRestModel() throws Exception {
getMockEndpoint("mock:hello").expectedMessageCount(1);
getMockEndpoint("mock:bar").expectedMessageCount(1);
- getMockEndpoint("mock:intercept").expectedMessageCount(3);
+ getMockEndpoint("mock:intercept").expectedMessageCount(4);
String out = template.requestBody("seda:get-say-hello", "I was here",
String.class);
assertEquals("Bye World", out);
diff --git
a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.xml
b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.xml
index 9d54413..71441f4 100644
---
a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.xml
+++
b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetInterceptTest.xml
@@ -22,27 +22,30 @@
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
- <!-- use a dummy rest consumer factory for the rest engine -->
- <bean id="dummy-rest"
class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest"
class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
- <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
- <intercept>
- <to uri="mock:intercept"/>
- </intercept>
+ <intercept>
+ <to uri="mock:intercept"/>
+ </intercept>
+
+ <rest path="/say/hello">
+ <get>
+ <to uri="direct:hello"/>
+ </get>
+ </rest>
- <rest path="/say/hello">
- <get>
<route>
- <to uri="mock:hello"/>
- <to uri="mock:bar"/>
- <transform>
- <constant>Bye World</constant>
- </transform>
+ <from uri="direct:hello"/>
+ <to uri="mock:hello"/>
+ <to uri="mock:bar"/>
+ <transform>
+ <constant>Bye World</constant>
+ </transform>
</route>
- </get>
- </rest>
- </camelContext>
+ </camelContext>
</blueprint>
\ No newline at end of file
diff --git
a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.xml
b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.xml
index 2c9b363..e12930f 100644
---
a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.xml
+++
b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetOnExceptionTest.xml
@@ -22,35 +22,38 @@
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
- <bean id="darn" class="java.lang.IllegalArgumentException">
- <argument index="0" value="Forced"/>
- </bean>
-
- <!-- use a dummy rest consumer factory for the rest engine -->
- <bean id="dummy-rest"
class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
-
- <camelContext xmlns="http://camel.apache.org/schema/blueprint">
-
- <onException>
- <exception>java.lang.IllegalArgumentException</exception>
- <handled>
- <constant>true</constant>
- </handled>
- <transform>
- <constant>Handled the error</constant>
- </transform>
- </onException>
-
- <rest path="/say/hello">
- <get>
+ <bean id="darn" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest"
class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <onException>
+ <exception>java.lang.IllegalArgumentException</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <transform>
+ <constant>Handled the error</constant>
+ </transform>
+ </onException>
+
+ <rest path="/say/hello">
+ <get>
+ <to uri="direct:hello"/>
+ </get>
+ </rest>
+
<route>
- <to uri="mock:hello"/>
- <to uri="mock:bar"/>
- <throwException ref="darn"/>
+ <from uri="direct:hello"/>
+ <to uri="mock:hello"/>
+ <to uri="mock:bar"/>
+ <throwException ref="darn"/>
</route>
- </get>
- </rest>
- </camelContext>
+ </camelContext>
</blueprint>
\ No newline at end of file
diff --git
a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.xml
b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.xml
index fde667d..2ec165f 100644
---
a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.xml
+++
b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/component/rest/FromRestGetRouteOnExceptionTest.xml
@@ -22,34 +22,37 @@
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
- <bean id="darn" class="java.lang.IllegalArgumentException">
- <argument index="0" value="Forced"/>
- </bean>
+ <bean id="darn" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
- <!-- use a dummy rest consumer factory for the rest engine -->
- <bean id="dummy-rest"
class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
+ <!-- use a dummy rest consumer factory for the rest engine -->
+ <bean id="dummy-rest"
class="org.apache.camel.test.blueprint.component.rest.DummyRestConsumerFactory"/>
- <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <rest path="/say/hello">
+ <get>
+ <to uri="direct:hello"/>
+ </get>
+ </rest>
- <rest path="/say/hello">
- <get>
<route>
- <onException>
- <exception>java.lang.IllegalArgumentException</exception>
- <handled>
- <constant>true</constant>
- </handled>
- <transform>
- <constant>Handled the error</constant>
- </transform>
- </onException>
- <to uri="mock:hello"/>
- <to uri="mock:bar"/>
- <throwException ref="darn"/>
+ <from uri="direct:hello"/>
+ <onException>
+ <exception>java.lang.IllegalArgumentException</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <transform>
+ <constant>Handled the error</constant>
+ </transform>
+ </onException>
+ <to uri="mock:hello"/>
+ <to uri="mock:bar"/>
+ <throwException ref="darn"/>
</route>
- </get>
- </rest>
- </camelContext>
+ </camelContext>
</blueprint>
\ No newline at end of file