You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "zhfeng (via GitHub)" <gi...@apache.org> on 2023/03/10 14:41:11 UTC

[GitHub] [camel-quarkus] zhfeng commented on a diff in pull request #4641: camel-quarkus-language: Added language, resource and options tests

zhfeng commented on code in PR #4641:
URL: https://github.com/apache/camel-quarkus/pull/4641#discussion_r1132463389


##########
integration-test-groups/foundation/language/src/main/java/org/apache/camel/quarkus/component/language/it/LanguageResource.java:
##########
@@ -23,21 +23,54 @@
 import jakarta.ws.rs.Path;
 import jakarta.ws.rs.PathParam;
 import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
 import jakarta.ws.rs.core.MediaType;
+import org.apache.camel.ConsumerTemplate;
 import org.apache.camel.ProducerTemplate;
 
 @Path("/language")
 @ApplicationScoped
 public class LanguageResource {
 
     @Inject
-    ProducerTemplate template;
+    ProducerTemplate producerTemplate;
+
+    @Inject
+    ConsumerTemplate consumerTemplate;
 
     @Path("/route/{route}")
     @POST
     @Consumes(MediaType.TEXT_PLAIN)
     @Produces(MediaType.TEXT_PLAIN)
     public String route(String body, @PathParam("route") String route) {
-        return template.requestBody("direct:" + route, body, String.class);
+        return producerTemplate.requestBody("direct:" + route, body, String.class);
+    }
+
+    @Path("/route/languageFileScript")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.TEXT_PLAIN)
+    public String routeFileScript(String body) {
+        return consumerTemplate.receiveBody("direct:languageFileOutput", 5000, String.class);
+    }
+
+    @Path("/route/languageSimpleHttp")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.TEXT_PLAIN)
+    public String routeSimpleHttp(String body, @QueryParam("baseUrl") String baseUrl) {
+        return producerTemplate.requestBody("language:simple:resource:" + baseUrl + "/simple", body, String.class);
+    }
+
+    @Path("/route/languageSimpleContentCache")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.TEXT_PLAIN)
+    public String routeSimpleContentCache(String body, @QueryParam("baseUrl") String baseUrl,
+            @QueryParam("contentCache") String contentCache) {
+        String option = "?contentCache=" + contentCache;
+        String url = "language:simple:resource:" + baseUrl + "/simpleContentCache" + option;
+        System.out.println(url);

Review Comment:
   It could be removed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org