This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git
The following commit(s) were added to refs/heads/camel-main by this push:
new 4b116d4 Fixed GroovyLoader tests for Camel Quarkus 2.0.0 / Camel 3.10
4b116d4 is described below
commit 4b116d42f7e07a7850a491e2d103e3878c1ec14d
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Tue Jun 1 16:26:08 2021 +0200
Fixed GroovyLoader tests for Camel Quarkus 2.0.0 / Camel 3.10
---
itests/camel-k-itests-loader-groovy/pom.xml | 6 +++---
.../org/apache/camel/k/loader/yaml/quarkus/Application.java | 4 ++--
.../apache/camel/k/loader/yaml/quarkus/GroovyLoaderTest.java | 10 +++++++---
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/itests/camel-k-itests-loader-groovy/pom.xml
b/itests/camel-k-itests-loader-groovy/pom.xml
index 7a8a12d..67ef363 100644
--- a/itests/camel-k-itests-loader-groovy/pom.xml
+++ b/itests/camel-k-itests-loader-groovy/pom.xml
@@ -71,9 +71,9 @@
<!-- The following dependencies guarantee that this module is built
after them. -->
<dependency>
- <groupId>org.apache.camel.k</groupId>
- <artifactId>camel-k-loader-groovy-deployment</artifactId>
- <version>${project.version}</version>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-groovy-dsl</artifactId>
+ <version>${camel-version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
diff --git
a/itests/camel-k-itests-loader-groovy/src/main/java/org/apache/camel/k/loader/yaml/quarkus/Application.java
b/itests/camel-k-itests-loader-groovy/src/main/java/org/apache/camel/k/loader/yaml/quarkus/Application.java
index fa5b2cb..cda4b30 100644
---
a/itests/camel-k-itests-loader-groovy/src/main/java/org/apache/camel/k/loader/yaml/quarkus/Application.java
+++
b/itests/camel-k-itests-loader-groovy/src/main/java/org/apache/camel/k/loader/yaml/quarkus/Application.java
@@ -19,6 +19,7 @@ package org.apache.camel.k.loader.yaml.quarkus;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.json.JsonObject;
+import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -26,7 +27,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.apache.camel.CamelContext;
-import org.apache.camel.Consume;
import org.apache.camel.k.loader.support.LoaderSupport;
@Path("/test")
@@ -37,7 +37,7 @@ public class Application {
@POST
@Path("/load-routes/{name}")
- @Consume(MediaType.TEXT_PLAIN)
+ @Consumes(MediaType.TEXT_PLAIN)
@Produces(MediaType.APPLICATION_JSON)
public JsonObject loadRoutes(@PathParam("name") String name, String code)
throws Exception {
return LoaderSupport.inspectSource(context, name + ".groovy", code);
diff --git
a/itests/camel-k-itests-loader-groovy/src/test/java/org/apache/camel/k/loader/yaml/quarkus/GroovyLoaderTest.java
b/itests/camel-k-itests-loader-groovy/src/test/java/org/apache/camel/k/loader/yaml/quarkus/GroovyLoaderTest.java
index 887ec53..f4b182d 100644
---
a/itests/camel-k-itests-loader-groovy/src/test/java/org/apache/camel/k/loader/yaml/quarkus/GroovyLoaderTest.java
+++
b/itests/camel-k-itests-loader-groovy/src/test/java/org/apache/camel/k/loader/yaml/quarkus/GroovyLoaderTest.java
@@ -26,6 +26,7 @@ import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.path.json.JsonPath;
import org.apache.camel.util.IOHelper;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
@@ -33,14 +34,17 @@ import static org.assertj.core.api.Assertions.assertThat;
@DisabledOnNativeImage
@QuarkusTest
public class GroovyLoaderTest {
- @Test
- public void testLoadRoutes() throws IOException {
- String code;
+ String code;
+ @BeforeEach
+ public void setUpRoute() throws IOException {
try (InputStream is =
GroovyLoaderTest.class.getResourceAsStream("/routes.groovy")) {
code = IOHelper.loadText(is);
}
+ }
+ @Test
+ public void testLoadRoutes() throws IOException {
JsonPath p = RestAssured.given()
.contentType(MediaType.TEXT_PLAIN)
.accept(MediaType.APPLICATION_JSON)