You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pp...@apache.org on 2021/05/19 10:17:32 UTC

[camel-quarkus] 06/15: Test Constant language in isolation #2613

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

ppalaga pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 3971f990852c60f40d63923cb01c846134b1a73c
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Tue May 18 15:03:22 2021 +0200

    Test Constant language in isolation #2613
---
 .../core/languages/it/ConstantLanguageRoutes.java  | 31 +++++++++++++++++++
 .../core/languages/it/ConstantLanguageIT.java      | 24 +++++++++++++++
 .../core/languages/it/ConstantLanguageTest.java    | 35 ++++++++++++++++++++++
 3 files changed, 90 insertions(+)

diff --git a/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/ConstantLanguageRoutes.java b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/ConstantLanguageRoutes.java
new file mode 100644
index 0000000..463b35e
--- /dev/null
+++ b/integration-test-groups/foundation/core-languages/src/main/java/org/apache/camel/quarkus/core/languages/it/ConstantLanguageRoutes.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.core.languages.it;
+
+import javax.inject.Singleton;
+
+import org.apache.camel.builder.RouteBuilder;
+
+@Singleton
+public class ConstantLanguageRoutes extends RouteBuilder {
+
+    @Override
+    public void configure() {
+        from("direct:constantLanguage")
+                .setBody().constant("as constant as 42");
+    }
+}
diff --git a/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ConstantLanguageIT.java b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ConstantLanguageIT.java
new file mode 100644
index 0000000..b167fd3
--- /dev/null
+++ b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ConstantLanguageIT.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.core.languages.it;
+
+import io.quarkus.test.junit.NativeImageTest;
+
+@NativeImageTest
+public class ConstantLanguageIT extends ConstantLanguageTest {
+
+}
diff --git a/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ConstantLanguageTest.java b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ConstantLanguageTest.java
new file mode 100644
index 0000000..aefbcc9
--- /dev/null
+++ b/integration-test-groups/foundation/core-languages/src/test/java/org/apache/camel/quarkus/core/languages/it/ConstantLanguageTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.core.languages.it;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import org.hamcrest.Matchers;
+import org.junit.jupiter.api.Test;
+
+@QuarkusTest
+public class ConstantLanguageTest {
+    @Test
+    public void constant() {
+        RestAssured.given()
+                .body("foo bar baz")
+                .post("/core-languages/route/constantLanguage/String")
+                .then()
+                .statusCode(200)
+                .body(Matchers.is("as constant as 42"));
+    }
+}