You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/02/22 12:01:24 UTC
[camel] 03/07: CAMEL-17675: camel-core - Rest DSL remove support for using inlined routes.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch rest-to
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 58dbceb817fd2daa414bb0349c85bc4fcfa36f4d
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Feb 22 10:12:11 2022 +0100
CAMEL-17675: camel-core - Rest DSL remove support for using inlined routes.
---
.../rest/SpringFromRestGetEmbeddedRouteTest.java | 30 -----------
.../rest/SpringFromRestGetEmbeddedRouteTest.xml | 58 ----------------------
.../rest/SpringFromRestGetInterceptTest.xml | 17 ++++---
.../rest/SpringFromRestGetOnExceptionTest.xml | 11 ++--
.../rest/SpringFromRestGetRouteOnExceptionTest.xml | 29 ++++++-----
5 files changed, 33 insertions(+), 112 deletions(-)
diff --git a/components/camel-spring-xml/src/test/java/org/apache/camel/component/rest/SpringFromRestGetEmbeddedRouteTest.java b/components/camel-spring-xml/src/test/java/org/apache/camel/component/rest/SpringFromRestGetEmbeddedRouteTest.java
deleted file mode 100644
index 4459c92..0000000
--- a/components/camel-spring-xml/src/test/java/org/apache/camel/component/rest/SpringFromRestGetEmbeddedRouteTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.component.rest;
-
-import org.apache.camel.CamelContext;
-
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
-
-public class SpringFromRestGetEmbeddedRouteTest extends FromRestGetEmbeddedRouteTest {
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- return createSpringCamelContext(this, "org/apache/camel/component/rest/SpringFromRestGetEmbeddedRouteTest.xml");
- }
-
-}
diff --git a/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetEmbeddedRouteTest.xml b/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetEmbeddedRouteTest.xml
deleted file mode 100644
index f477576..0000000
--- a/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetEmbeddedRouteTest.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
- ">
-
- <!-- use a dummy rest consumer factory for the rest engine -->
- <bean id="dummy-rest" class="org.apache.camel.component.rest.DummyRestConsumerFactory"/>
-
- <camelContext xmlns="http://camel.apache.org/schema/spring">
-
- <rest path="/say/hello">
- <get>
- <route>
- <to uri="mock:hello"/>
- <transform>
- <constant>Hello World</constant>
- </transform>
- </route>
- </get>
- </rest>
- <rest path="/say/bye">
- <get consumes="application/json">
- <route>
- <to uri="mock:bye"/>
- <transform>
- <constant>Bye World</constant>
- </transform>
- </route>
- </get>
- <post>
- <to uri="mock:update"/>
- </post>
- </rest>
-
- </camelContext>
-
-</beans>
diff --git a/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetInterceptTest.xml b/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetInterceptTest.xml
index 39f9ebb..b75af92 100644
--- a/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetInterceptTest.xml
+++ b/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetInterceptTest.xml
@@ -35,16 +35,19 @@
<rest path="/say/hello">
<get>
- <route>
- <to uri="mock:hello"/>
- <to uri="mock:bar"/>
- <transform>
- <constant>Bye World</constant>
- </transform>
- </route>
+ <to uri="direct:hello"/>
</get>
</rest>
+ <route>
+ <from uri="direct:hello"/>
+ <to uri="mock:hello"/>
+ <to uri="mock:bar"/>
+ <transform>
+ <constant>Bye World</constant>
+ </transform>
+ </route>
+
</camelContext>
</beans>
diff --git a/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetOnExceptionTest.xml b/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetOnExceptionTest.xml
index 77c656c..a4bae7c 100644
--- a/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetOnExceptionTest.xml
+++ b/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetOnExceptionTest.xml
@@ -45,13 +45,16 @@
<rest path="/say/hello">
<get>
- <route>
- <to uri="mock:hello"/>
- <throwException ref="darn"/>
- </route>
+ <to uri="direct:hello"/>
</get>
</rest>
+ <route>
+ <from uri="direct:hello"/>
+ <to uri="mock:hello"/>
+ <throwException ref="darn"/>
+ </route>
+
</camelContext>
</beans>
diff --git a/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetRouteOnExceptionTest.xml b/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetRouteOnExceptionTest.xml
index 0c98a4c..064a968 100644
--- a/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetRouteOnExceptionTest.xml
+++ b/components/camel-spring-xml/src/test/resources/org/apache/camel/component/rest/SpringFromRestGetRouteOnExceptionTest.xml
@@ -35,22 +35,25 @@
<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"/>
- <throwException ref="darn"/>
- </route>
+ <to uri="direct:hello"/>
</get>
</rest>
+ <route>
+ <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"/>
+ <throwException ref="darn"/>
+ </route>
+
</camelContext>
</beans>