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


##########
integration-tests/validator/src/test/java/org/apache/camel/quarkus/component/validator/it/ValidatorTest.java:
##########
@@ -16,84 +16,40 @@
  */
 package org.apache.camel.quarkus.component.validator.it;
 
+import io.quarkus.test.common.QuarkusTestResource;
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
 import io.restassured.http.ContentType;
-import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
 
 @QuarkusTest
+@QuarkusTestResource(ValidatorTestResource.class)
 class ValidatorTest {
 
-    @Test
-    public void validXMLFromClassPath() {
+    @ParameterizedTest
+    @ValueSource(strings = { "classpath", "filesystem", "http" })
+    public void validXML(String scheme) {
 
         RestAssured.given()
                 .contentType(ContentType.XML)
                 
.body("<message><firstName>MyFirstname</firstName><lastName>MyLastname</lastName></message>")
-                .post("/validator/classpath")
+                .post("/validator/validate/" + scheme)
                 .then()
                 .statusCode(200);
 
     }
 
-    @Test
-    public void invalidXMLFromClassPath() {
+    @ParameterizedTest
+    @ValueSource(strings = { "classpath", "filesystem", "http" })
+    public void inValidXML(String scheme) {
 
         RestAssured.given()
                 .contentType(ContentType.XML)
                 .body("<message><firstName>MyFirstname</firstName></message>")
-                .post("/validator/classpath")
+                .post("/validator/validate/" + scheme)
                 .then()
                 .statusCode(500);

Review Comment:
   The tests are failing. You might want to forward the exception message to 
the client in `ValidatorResource`. Something like 
   
   ```
       public javax.ws.rs.core.Response processOrderInXml(String statement, 
@PathParam("scheme") String scheme) {
           try {
               return 
javax.ws.rs.core.Response.ok().entity(producerTemplate.requestBody("direct:" + 
scheme, statement, String.class));
           } catch (Exception e) {
                   return 
javax.ws.rs.core.Response.serverError().entity(e.getMessage());
           }
               
       }
   ```



-- 
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