This is an automated email from the ASF dual-hosted git repository.

fmariani pushed a commit to branch camel-spring-boot-3.20.x
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/camel-spring-boot-3.20.x by 
this push:
     new 5f513442d08 Fix CxfRsProducerSessionTest on jdk17
5f513442d08 is described below

commit 5f513442d08ce4d4eb6b98472dd674facbca7fc8
Author: Marco Carletti <[email protected]>
AuthorDate: Wed Feb 8 15:16:54 2023 +0100

    Fix CxfRsProducerSessionTest on jdk17
---
 .../camel/component/cxf/jaxrs/testbean/EchoService.java  | 16 ++--------------
 .../testbean/{EchoService.java => EchoServiceImpl.java}  |  7 +------
 .../test/resources/routes/CxfRsSpringProducerSession.xml |  2 +-
 3 files changed, 4 insertions(+), 21 deletions(-)

diff --git 
a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/EchoService.java
 
b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/EchoService.java
index abba335cd10..ef24b2c92d6 100644
--- 
a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/EchoService.java
+++ 
b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/EchoService.java
@@ -18,24 +18,12 @@ package org.apache.camel.component.cxf.jaxrs.testbean;
 
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.NewCookie;
 import javax.ws.rs.core.Response;
 
 @Path("/echoservice/")
-public class EchoService {
-    @Context
-    private HttpHeaders headers;
+public interface EchoService {
 
     @POST
     @Path("/echo/")
-    public Response echo(String string) {
-        Cookie fooCookie = headers.getCookies().get("foo");
-        if (fooCookie != null && "bar".equals(fooCookie.getValue())) {
-            return Response.ok("Old " + string).build();
-        }
-        return Response.ok("New " + string).cookie(new NewCookie("foo", "bar", 
"/", null, 1, null, -1, false)).build();
-    }
+    Response echo(String string);
 }
diff --git 
a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/EchoService.java
 
b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/EchoServiceImpl.java
similarity index 91%
copy from 
components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/EchoService.java
copy to 
components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/EchoServiceImpl.java
index abba335cd10..0e29644f7df 100644
--- 
a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/EchoService.java
+++ 
b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/EchoServiceImpl.java
@@ -16,21 +16,16 @@
  */
 package org.apache.camel.component.cxf.jaxrs.testbean;
 
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Cookie;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.NewCookie;
 import javax.ws.rs.core.Response;
 
-@Path("/echoservice/")
-public class EchoService {
+public class EchoServiceImpl implements EchoService {
     @Context
     private HttpHeaders headers;
 
-    @POST
-    @Path("/echo/")
     public Response echo(String string) {
         Cookie fooCookie = headers.getCookies().get("foo");
         if (fooCookie != null && "bar".equals(fooCookie.getValue())) {
diff --git 
a/components-starter/camel-cxf-rest-starter/src/test/resources/routes/CxfRsSpringProducerSession.xml
 
b/components-starter/camel-cxf-rest-starter/src/test/resources/routes/CxfRsSpringProducerSession.xml
index db00a27e1c8..98c23f78bd9 100644
--- 
a/components-starter/camel-cxf-rest-starter/src/test/resources/routes/CxfRsSpringProducerSession.xml
+++ 
b/components-starter/camel-cxf-rest-starter/src/test/resources/routes/CxfRsSpringProducerSession.xml
@@ -39,7 +39,7 @@
     </jaxrs:serviceBeans>       
   </jaxrs:server>
   
-  <bean id="echoService" 
class="org.apache.camel.component.cxf.jaxrs.testbean.EchoService" />
+  <bean id="echoService" 
class="org.apache.camel.component.cxf.jaxrs.testbean.EchoServiceImpl" />
 
   <cxf:rsClient id="rsClientProxy" 
address="http://localhost:8080/services/CxfRsProducerSessionTest/";
     serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.EchoService"

Reply via email to