aldettinger commented on code in PR #3972:
URL: https://github.com/apache/camel-quarkus/pull/3972#discussion_r941464371


##########
integration-tests/validator/src/main/java/org/apache/camel/quarkus/component/validator/it/ValidatorRouteBuilder.java:
##########
@@ -16,19 +16,47 @@
  */
 package org.apache.camel.quarkus.component.validator.it;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+
 import org.apache.camel.builder.RouteBuilder;
+import org.eclipse.microprofile.config.ConfigProvider;
 
 public class ValidatorRouteBuilder extends RouteBuilder {
+
     @Override
     public void configure() {
+        // validator from the classpath resource
         from("direct:classpath")
                 .to("validator:message.xsd");
 
+        // validator from the filesytem
+        String xsdLocation = createTempXsd("message.xsd");
+
         from("direct:filesystem")
-                .to("validator:file:src/main/resources/message.xsd");
+                .to("validator:file:" + xsdLocation);
+        // validator from a http endpoint.
+        String serverURL = ConfigProvider.getConfig()
+                .getConfigValue("xsd.server-url")
+                .getRawValue();
 
         from("direct:http")
-                
.toD("validator:https://raw.githubusercontent.com/apache/camel-quarkus/main/integration-tests/validator/src/main/resources/message.xsd";);
+                .toD("validator:" + serverURL + "/xsd");
 
     }
+
+    public String createTempXsd(String sourceXsd) {

Review Comment:
   Nice trick so that it works on platform also :+1: 



-- 
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-unsubscr...@camel.apache.org

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

Reply via email to