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 2020/08/26 19:04:16 UTC

[camel-quarkus] branch 1.0.x updated (f1bbe51 -> 7f6cf66)

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

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


    from f1bbe51  Switch from restcountries.eu to estcountries.com as the .eu service is not reliable anymorei #1538
     new bbf170a  Avoid purging artifacts for builds that may be in progress
     new e64d343  Add missing netty dependencies to olingo4 extension
     new 1ecf797  Skip native tests if the pull request has 'JVM' label
     new 92e5177  Fix #1602 Speed up the CI
     new 2bd704a  Rebalance test categories
     new c23968d  No need to spend 3m 45s by deleting unwanted SDKs, there is enough space on disk
     new 8fce3c0  Do not run functional-extension-tests if the PR has 'JVM' label set
     new 5549f8c  Upgrade Quarkus to 1.7.1.Final
     new 48ed95e  Fix telegram itest component property resolution
     new 1bf9e3a  Fix itest when Twitter acount have spaces in name
     new 03e8e3b  Clean google drive in google sheets itest
     new 69e038b  Fix servicenow itest to clean resources
     new fc11baf  Send unique messages in Slack itest to avoid false positive tests
     new 7f6cf66  Fixed the VerifyError in the health example fixes #1517

The 14 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/ci-build.yaml                    | 168 ++++++++++++++++++---
 .github/workflows/purge-stale-artifacts-cron.yaml  |   3 +-
 examples/health/README.adoc                        |  17 ++-
 examples/health/pom.xml                            |   4 +
 .../main/java/org/acme/health/MyRouteBuilder.java  |  14 +-
 ...HealthCheck.java => RunTooLongHealthCheck.java} |  32 ++--
 extensions/olingo4/deployment/pom.xml              |   4 +
 extensions/olingo4/runtime/pom.xml                 |   4 +
 .../component/google/it/GoogleComponentsTest.java  |  13 ++
 .../servicenow/it/ServicenowResource.java          |  47 +++++-
 .../component/servicenow/it/ServicenowTest.java    |  27 +++-
 .../quarkus/component/slack/it/SlackResource.java  |   4 +-
 .../quarkus/component/slack/it/SlackTest.java      |  15 +-
 integration-tests/telegram/pom.xml                 |   4 +
 .../quarkus/component/twitter/CamelResource.java   |   5 +-
 pom.xml                                            |   2 +-
 tooling/scripts/test-categories.yaml               |  36 ++---
 17 files changed, 311 insertions(+), 88 deletions(-)
 rename examples/health/src/main/java/org/acme/health/{MonkeyHealthCheck.java => RunTooLongHealthCheck.java} (63%)


[camel-quarkus] 14/14: Fixed the VerifyError in the health example fixes #1517

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7f6cf66fc073cd698bf617ece375efc38857006f
Author: aldettinger <al...@gmail.com>
AuthorDate: Mon Aug 10 15:35:25 2020 +0200

    Fixed the VerifyError in the health example fixes #1517
---
 examples/health/README.adoc                        | 17 ++++++------
 examples/health/pom.xml                            |  4 +++
 .../main/java/org/acme/health/MyRouteBuilder.java  | 14 ++--------
 ...HealthCheck.java => RunTooLongHealthCheck.java} | 32 +++++++++-------------
 4 files changed, 28 insertions(+), 39 deletions(-)

diff --git a/examples/health/README.adoc b/examples/health/README.adoc
index 964c972..d61bc6b 100644
--- a/examples/health/README.adoc
+++ b/examples/health/README.adoc
@@ -7,16 +7,16 @@ them automatic discovered by Camel and used as parts of its health-check system.
 TIP: Check the https://camel.apache.org/camel-quarkus/latest/first-steps.html[Camel Quarkus User guide] for prerequisites
 and other general information.
 
-The example has two routes, a timer that calls a bean that flips a boolean that
-causes the custom health check to be in either UP or DOWN state.
+The example has two routes. The timer route performs a given task at regular interval. For the sake of this example we'll say
+that this task unexpectedly freezes the service from time to time. The details can be consulted at http://localhost:8080/health. 
+The custom health check is expected to report UNKNOWN on first consultation, then UP during 10 seconds, and finally DOWN so as to
+simulate that the service is frozen.
 
 The 2nd route is on purpose made to fail on startup by configuring netty to an unknown host.
 Camel supervising route controller will attempt to restart the route up till 10 times before exhausting.
+The routes health check will therefore report this route as DOWN until its exhausted where the states are changed to UNKNOWN.
 
-The routes health check will therefore report this route as DOWN until its exhausted
-where the states are changed to UNKNOWN.
-
-The details can be seen at runtime from the calling the following url from a web browser: http://localhost:8080/health
+The details can be seen at runtime via the following url from a web browser: http://localhost:8080/health.
 
 === Start in the Development mode
 
@@ -44,10 +44,11 @@ https://camel.apache.org/camel-quarkus/latest/first-steps.html#_package_and_run_
 
 [source,shell]
 ----
+
 $ mvn clean package
 $ java -jar target/*-runner.jar
 ...
-[io.quarkus] (main) Quarkus 1.3.2 started in 1.163s. Listening on: http://[::]:8080
+[io.quarkus] (main) camel-quarkus-examples-... started in 0.885s. Listening on: http://0.0.0.0:8080
 ----
 
 === Native mode
@@ -62,7 +63,7 @@ To prepare a native executable using GraalVM, run the following command:
 $ mvn clean package -Pnative
 $ ./target/*-runner
 ...
-[io.quarkus] (main) Quarkus 1.3.2 started in 0.013s. Listening on: http://[::]:8080
+[io.quarkus] (main) camel-quarkus-examples-... started in 0.026s. Listening on: http://0.0.0.0:8080
 ...
 ----
 
diff --git a/examples/health/pom.xml b/examples/health/pom.xml
index c5e6df3..0ab2733 100644
--- a/examples/health/pom.xml
+++ b/examples/health/pom.xml
@@ -57,6 +57,10 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-netty</artifactId>
         </dependency>
         <dependency>
diff --git a/examples/health/src/main/java/org/acme/health/MyRouteBuilder.java b/examples/health/src/main/java/org/acme/health/MyRouteBuilder.java
index 88288db..11dc4aa 100644
--- a/examples/health/src/main/java/org/acme/health/MyRouteBuilder.java
+++ b/examples/health/src/main/java/org/acme/health/MyRouteBuilder.java
@@ -16,23 +16,13 @@
  */
 package org.acme.health;
 
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
 import org.apache.camel.builder.RouteBuilder;
 
-@ApplicationScoped
 public class MyRouteBuilder extends RouteBuilder {
 
-    // we can inject the bean via this annotation
-    @Inject
-    MonkeyHealthCheck monkey;
-
     @Override
-    public void configure() throws Exception {
-        from("timer:foo?period={{myPeriod}}").routeId("timer")
-                .bean(monkey, "chaos")
-                .log("${body}");
+    public void configure() {
+        from("timer:foo?period={{myPeriod}}").routeId("timer").log("Doing one more task");
 
         // this route is invalid and fails during startup
         // the supervising route controller will take over and attempt
diff --git a/examples/health/src/main/java/org/acme/health/MonkeyHealthCheck.java b/examples/health/src/main/java/org/acme/health/RunTooLongHealthCheck.java
similarity index 63%
rename from examples/health/src/main/java/org/acme/health/MonkeyHealthCheck.java
rename to examples/health/src/main/java/org/acme/health/RunTooLongHealthCheck.java
index 479d60c..db187d6 100644
--- a/examples/health/src/main/java/org/acme/health/MonkeyHealthCheck.java
+++ b/examples/health/src/main/java/org/acme/health/RunTooLongHealthCheck.java
@@ -18,42 +18,36 @@ package org.acme.health;
 
 import java.util.Map;
 
-import javax.enterprise.context.ApplicationScoped;
-
 import org.apache.camel.health.HealthCheckResultBuilder;
 import org.apache.camel.impl.health.AbstractHealthCheck;
 
 /**
- * A chaos monkey health check that reports UP or DOWN in a chaotic way.
- *
- * This is a custom implementation of a Camel {@link org.apache.camel.health.HealthCheck}
- * which is automatic discovered if bound in the {@link org.apache.camel.spi.Registry} and
- * used as part of Camel's health-check system.
+ * A user defined health check that reports UNKNOWN on first call, then UP for
+ * 10 seconds and finally DOWN afterward. This is a custom implementation of a
+ * Camel {@link org.apache.camel.health.HealthCheck} and used as part of Camel's
+ * health-check system.
  */
-@ApplicationScoped
-public class MonkeyHealthCheck extends AbstractHealthCheck {
+public class RunTooLongHealthCheck extends AbstractHealthCheck {
 
-    private boolean up = true;
+    private volatile long firstCallTimeMillis = 0;
 
-    public MonkeyHealthCheck() {
-        super("custom", "monkey");
+    public RunTooLongHealthCheck() {
+        super("custom", "toolong");
     }
 
     @Override
     protected void doCall(HealthCheckResultBuilder builder, Map<String, Object> options) {
-        builder.detail("monkey", "The chaos monkey was here");
-        if (up) {
+        builder.detail("toolong", "Reports DOWN when run for too long");
+        if (firstCallTimeMillis == 0) {
+            builder.unknown();
+            firstCallTimeMillis = System.currentTimeMillis();
+        } else if ((System.currentTimeMillis() - firstCallTimeMillis) < 10 * 1000L) {
             builder.up();
         } else {
             builder.down();
         }
     }
 
-    public String chaos() {
-        up = !up;
-        return up ? "All is okay" : "Chaos monkey was here";
-    }
-
     @Override
     public boolean isReadiness() {
         // only liveness probe


[camel-quarkus] 05/14: Rebalance test categories

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2bd704ae3fff16ddc245f212a0b5c17e821a4dca
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Wed Aug 26 14:17:26 2020 +0200

    Rebalance test categories
---
 tooling/scripts/test-categories.yaml | 36 ++++++++++++++++--------------------
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml
index bcc4153..36f5994 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -22,9 +22,8 @@ cloud:
   - azure
   - consul
   - elasticsearch-rest
-core:
+core-main-validation:
   - core
-main:
   - main
   - main-caffeine-lrucache
   - main-collector
@@ -32,6 +31,9 @@ main:
   - main-command-mode
   - main-xml-io
   - main-xml-jaxb
+  - bean-validator
+  - json-validator
+  - validator
 database:
   - couchdb
   - debezium
@@ -63,17 +65,16 @@ foundation:
   - ref
   - seda
   - send-dynamic-http
-memoryhog-dataformat-json:
+xml-json-olingo4:
+  - rest-binding-mode-xml
+  - xml
   - dataformats-json
-memoryhog-dozer:
+  - olingo4
+dozer-ispn-social:
   - dozer
-memoryhog-infinispan:
   - infinispan
-memoryhog-olingo4:
-  - olingo4
-memoryhog-xml:
-  - rest-binding-mode-xml
-  - xml
+  - telegram
+  - twitter
 messaging:
   - activemq
   - amqp
@@ -90,16 +91,18 @@ misc:
   - pdf
   - qute
   - stream
-  - tarfile
   - tika
-  - vertx
-networking:
+networking-dataformats:
   - ftp
   - http
   - mail
   - netty
   - servlet
   - websocket-jsr356
+  - vertx
+  - compression
+  - grok
+  - tarfile
 platform:
   - microprofile
   - openapi-java
@@ -118,10 +121,3 @@ saas:
   - sap-netweaver
   - servicenow
   - slack
-social:
-  - telegram
-  - twitter
-validation:
-  - bean-validator
-  - json-validator
-  - validator


[camel-quarkus] 01/14: Avoid purging artifacts for builds that may be in progress

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bbf170af014f8639f03a3ae5b702f87d3b2f0764
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Aug 13 10:05:48 2020 +0100

    Avoid purging artifacts for builds that may be in progress
---
 .github/workflows/purge-stale-artifacts-cron.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/purge-stale-artifacts-cron.yaml b/.github/workflows/purge-stale-artifacts-cron.yaml
index 697ebb9..07510e6 100644
--- a/.github/workflows/purge-stale-artifacts-cron.yaml
+++ b/.github/workflows/purge-stale-artifacts-cron.yaml
@@ -29,8 +29,9 @@ jobs:
     steps:
       - name: Purge Stale Artifacts
         run: |
+          TWELVE_HOURS_AGO="$(date --iso-8601=seconds -d "-12 hours" | cut -f1 -d'+')Z"
           ARTIFACTS=$(curl -s -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/artifacts)
-          for ID in $(echo ${ARTIFACTS} | jq '.artifacts[] | select (.expired == false and .name == "maven-repo") | .id'); do
+          for ID in $(echo ${ARTIFACTS} | jq --arg twelveHoursAgo ${TWELVE_HOURS_AGO} '.artifacts[] | select (.expired == false and .name == "maven-repo" and .created_at <= $twelveHoursAgo) | .id'); do
               echo "Deleting artifact ${ID} from ${GITHUB_REPOSITORY}"
               curl -s -X DELETE -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/artifacts/${ID}
               sleep 5


[camel-quarkus] 06/14: No need to spend 3m 45s by deleting unwanted SDKs, there is enough space on disk

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c23968d56851bfbe0780185951671c65e34a1ab2
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Wed Aug 26 14:25:22 2020 +0200

    No need to spend 3m 45s by deleting unwanted SDKs, there is enough space on disk
---
 .github/workflows/ci-build.yaml | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index a0f2c034..39f4788 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -56,17 +56,9 @@ jobs:
         uses: n1hility/cancel-previous-runs@v2
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
-      - name: Clean VM
+      - name: Check free space on disk
         run: |
           df -h /
-          echo "Removing unwanted SDKs"
-          sudo rm -rf /usr/local/lib/android \
-               rm -rf /usr/local/share/boost \
-               rm -rf /usr/local/go \
-               rm -rf /usr/share/dotnet \
-               rm -rf /usr/share/rust
-
-          df -h /
       - name: Setup apache-snapshots profile
         if: github.ref == 'refs/heads/camel-master' || github.base_ref == 'camel-master'
         run: |


[camel-quarkus] 02/14: Add missing netty dependencies to olingo4 extension

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e64d343eb05fd086c1fd84a8ec88aaac1b3f3c27
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Aug 19 08:36:23 2020 +0100

    Add missing netty dependencies to olingo4 extension
---
 extensions/olingo4/deployment/pom.xml | 4 ++++
 extensions/olingo4/runtime/pom.xml    | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/extensions/olingo4/deployment/pom.xml b/extensions/olingo4/deployment/pom.xml
index 5e75c13..de27760 100644
--- a/extensions/olingo4/deployment/pom.xml
+++ b/extensions/olingo4/deployment/pom.xml
@@ -51,6 +51,10 @@
             <artifactId>quarkus-jackson-deployment</artifactId>
         </dependency>
         <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-netty-deployment</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-olingo4</artifactId>
         </dependency>
diff --git a/extensions/olingo4/runtime/pom.xml b/extensions/olingo4/runtime/pom.xml
index 5c18ecb..dc2912a 100644
--- a/extensions/olingo4/runtime/pom.xml
+++ b/extensions/olingo4/runtime/pom.xml
@@ -67,6 +67,10 @@
             <artifactId>quarkus-jackson</artifactId>
         </dependency>
         <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-netty</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-olingo4</artifactId>
         </dependency>


[camel-quarkus] 03/14: Skip native tests if the pull request has 'JVM' label

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1ecf797a2cb71ea1d2fdc66780c40bdc7573412e
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Mon Aug 24 21:17:34 2020 +0200

    Skip native tests if the pull request has 'JVM' label
---
 .github/workflows/ci-build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index d7f4273..a79b350 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -162,6 +162,7 @@ jobs:
     name: Native Tests - ${{matrix.category}}
     needs: build
     runs-on: ubuntu-latest
+    if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'JVM')
     strategy:
       fail-fast: false
       matrix: ${{ fromJson(needs.build.outputs.matrix) }}


[camel-quarkus] 09/14: Fix telegram itest component property resolution

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 48ed95e7951b84c2cf06cc5f405b09256638075f
Author: Lukas Lowinger <ll...@redhat.com>
AuthorDate: Fri Aug 21 09:55:10 2020 +0200

    Fix telegram itest component property resolution
---
 integration-tests/telegram/pom.xml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/integration-tests/telegram/pom.xml b/integration-tests/telegram/pom.xml
index 0891f9c..6fd16d2 100644
--- a/integration-tests/telegram/pom.xml
+++ b/integration-tests/telegram/pom.xml
@@ -42,6 +42,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-telegram</artifactId>
         </dependency>
         <dependency>


[camel-quarkus] 08/14: Upgrade Quarkus to 1.7.1.Final

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5549f8c3dbbb49fce1d309f1be9178d10ea585ec
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Aug 26 14:40:53 2020 +0100

    Upgrade Quarkus to 1.7.1.Final
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index c65d485..112d12e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@
         <kotlin.version>1.3.72</kotlin.version>
         <okhttp.version>3.14.6</okhttp.version><!-- keep in sync with okio -->
         <okio.version>1.17.2</okio.version><!-- keep in sync with okhttp -->
-        <quarkus.version>1.7.0.Final</quarkus.version>
+        <quarkus.version>1.7.1.Final</quarkus.version>
         <quarkus-qpid-jms.version>0.17.0</quarkus-qpid-jms.version>
         <protobuf.version>3.11.1</protobuf.version>
         <retrofit.version>2.5.0</retrofit.version>


[camel-quarkus] 10/14: Fix itest when Twitter acount have spaces in name

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1bf9e3a61330f7aba60181c2a4f0f5776ff59ede
Author: Lukas Lowinger <ll...@redhat.com>
AuthorDate: Fri Aug 21 13:51:55 2020 +0200

    Fix itest when Twitter acount have spaces in name
---
 .../org/apache/camel/quarkus/component/twitter/CamelResource.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/integration-tests/twitter/src/main/java/org/apache/camel/quarkus/component/twitter/CamelResource.java b/integration-tests/twitter/src/main/java/org/apache/camel/quarkus/component/twitter/CamelResource.java
index 0ec2860..d46d3b9 100644
--- a/integration-tests/twitter/src/main/java/org/apache/camel/quarkus/component/twitter/CamelResource.java
+++ b/integration-tests/twitter/src/main/java/org/apache/camel/quarkus/component/twitter/CamelResource.java
@@ -17,6 +17,8 @@
 package org.apache.camel.quarkus.component.twitter;
 
 import java.net.URI;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
@@ -68,7 +70,8 @@ public class CamelResource {
         final Status s = producerTemplate.requestBody("twitter-timeline://user", message, Status.class);
         LOG.infof("Posted a tweet %s", s.getText());
         return Response
-                .created(new URI(String.format("https://twitter.com/%s/status/%d", s.getUser().getName(), s.getId())))
+                .created(new URI(String.format("https://twitter.com/%s/status/%d",
+                        URLEncoder.encode(s.getUser().getName(), StandardCharsets.UTF_8.toString()), s.getId())))
                 .header("messageId", s.getId())
                 .entity(s.getText())
                 .build();


[camel-quarkus] 07/14: Do not run functional-extension-tests if the PR has 'JVM' label set

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8fce3c0280f546fe8e1ffea4e296a7f369997f69
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Wed Aug 26 14:26:14 2020 +0200

    Do not run functional-extension-tests if the PR has 'JVM' label set
---
 .github/workflows/ci-build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index 39f4788..c1c7fba 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -109,6 +109,7 @@ jobs:
   functional-extension-tests:
     runs-on: ubuntu-latest
     needs: build
+    if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'JVM')
     strategy:
       fail-fast: false
       matrix:


[camel-quarkus] 12/14: Fix servicenow itest to clean resources

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 69e038b8e852361e10528677545a3d69f3dc23e8
Author: Lukas Lowinger <ll...@redhat.com>
AuthorDate: Tue Aug 25 10:55:48 2020 +0200

    Fix servicenow itest to clean resources
---
 .../servicenow/it/ServicenowResource.java          | 47 ++++++++++++++++++++--
 .../component/servicenow/it/ServicenowTest.java    | 27 ++++++++++++-
 2 files changed, 70 insertions(+), 4 deletions(-)

diff --git a/integration-tests/servicenow/src/main/java/org/apache/camel/quarkus/component/servicenow/it/ServicenowResource.java b/integration-tests/servicenow/src/main/java/org/apache/camel/quarkus/component/servicenow/it/ServicenowResource.java
index b59b21c..d280741 100644
--- a/integration-tests/servicenow/src/main/java/org/apache/camel/quarkus/component/servicenow/it/ServicenowResource.java
+++ b/integration-tests/servicenow/src/main/java/org/apache/camel/quarkus/component/servicenow/it/ServicenowResource.java
@@ -23,9 +23,12 @@ import java.util.Map;
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
@@ -70,13 +73,51 @@ public class ServicenowResource {
         LOG.infof("Sending to servicenow: %s", message);
         final JsonNode response = producerTemplate.requestBodyAndHeaders(
                 "servicenow:" + instance, incident, headers, JsonNode.class);
-
-        String number = response.findPath("number").textValue();
+        String sysId = response.findPath("sys_id").textValue();
 
         LOG.infof("Got response from servicenow: %s", response);
         return Response
                 .created(new URI("https://camel.apache.org/"))
-                .entity(number)
+                .entity(sysId)
                 .build();
     }
+
+    @Path("/get")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response get(@QueryParam("incidentSysId") String incidentSysId) {
+
+        Map<String, Object> headers = new HashMap<>();
+        headers.put(ServiceNowConstants.RESOURCE, ServiceNowConstants.RESOURCE_TABLE);
+        headers.put(ServiceNowConstants.API_VERSION, "v1");
+        headers.put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE);
+        headers.put(ServiceNowParams.PARAM_TABLE_NAME.getHeader(), "incident");
+        headers.put(ServiceNowParams.PARAM_SYS_ID.getHeader(), incidentSysId);
+        headers.put(ServiceNowConstants.RESPONSE_MODEL, JsonNode.class);
+
+        try {
+            final JsonNode response = producerTemplate.requestBodyAndHeaders("servicenow:" + instance, null, headers,
+                    JsonNode.class);
+            LOG.infof("Got response from servicenow: %s", response);
+            String number = response.findPath("number").textValue();
+            return Response.ok(number).build();
+        } catch (Exception e) {
+            LOG.error(e);
+            return Response.status(Response.Status.NOT_FOUND).build();
+        }
+    }
+
+    @Path("/delete")
+    @DELETE
+    public Response delete(@QueryParam("incidentSysId") String incidentSysId) {
+        Map<String, Object> headers = new HashMap<>();
+        headers.put(ServiceNowConstants.RESOURCE, ServiceNowConstants.RESOURCE_TABLE);
+        headers.put(ServiceNowConstants.API_VERSION, "v1");
+        headers.put(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_DELETE);
+        headers.put(ServiceNowParams.PARAM_TABLE_NAME.getHeader(), "incident");
+        headers.put(ServiceNowParams.PARAM_SYS_ID.getHeader(), incidentSysId);
+
+        producerTemplate.requestBodyAndHeaders("servicenow:" + instance, null, headers);
+        return Response.status(Response.Status.NO_CONTENT).build();
+    }
 }
diff --git a/integration-tests/servicenow/src/test/java/org/apache/camel/quarkus/component/servicenow/it/ServicenowTest.java b/integration-tests/servicenow/src/test/java/org/apache/camel/quarkus/component/servicenow/it/ServicenowTest.java
index 8168518..7b88a56 100644
--- a/integration-tests/servicenow/src/test/java/org/apache/camel/quarkus/component/servicenow/it/ServicenowTest.java
+++ b/integration-tests/servicenow/src/test/java/org/apache/camel/quarkus/component/servicenow/it/ServicenowTest.java
@@ -32,12 +32,37 @@ class ServicenowTest {
 
     @Test
     public void test() {
-        RestAssured.given()
+        // Create incident
+        final String incidentSysId = RestAssured.given()
                 .contentType(ContentType.TEXT)
                 .body("Demo incident")
                 .post("/servicenow/post")
                 .then()
                 .statusCode(201)
+                .extract().body().asString();
+
+        // Retrieve incident
+        RestAssured.given()
+                .contentType(ContentType.TEXT)
+                .queryParam("incidentSysId", incidentSysId)
+                .get("/servicenow/get")
+                .then()
+                .statusCode(200)
                 .body(matchesPattern("INC[0-9]+"));
+
+        // Delete incident
+        RestAssured.given()
+                .queryParam("incidentSysId", incidentSysId)
+                .delete("/servicenow/delete")
+                .then()
+                .statusCode(204);
+
+        // Check it is deleted
+        RestAssured.given()
+                .contentType(ContentType.TEXT)
+                .queryParam("incidentSysId", incidentSysId)
+                .get("/servicenow/get")
+                .then()
+                .statusCode(404);
     }
 }


[camel-quarkus] 04/14: Fix #1602 Speed up the CI

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 92e5177380bbc241e65dfd7b2c7ddb28673d2f4f
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Tue Aug 25 15:47:36 2020 +0200

    Fix #1602 Speed up the CI
---
 .github/workflows/ci-build.yaml | 156 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 146 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index a79b350..a0f2c034 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -88,10 +88,9 @@ jobs:
             && ./mvnw -B clean install -DskipTests -DskipITs
       - name: Checkout
         uses: actions/checkout@v2
-      - name: Build Project
+      - name: mvn clean install -DskipTests
         run: |
-          ./mvnw -V -ntp ${BRANCH_OPTIONS} \
-            clean install
+          ./mvnw -V -ntp ${BRANCH_OPTIONS} clean install -DskipTests -Dquarkus.build.skip
       - name: Fail if there are uncommitted changes
         shell: bash
         run: |
@@ -115,13 +114,13 @@ jobs:
           CATEGORIES=$(cat tooling/scripts/test-categories.yaml | yq r - --printMode p "*." | sed "s/\(.*\)/'\1'/" | sed ':a;N;$!ba;s/\n/,/g')
           echo "::set-output name=matrix::{'category': [${CATEGORIES}]}"
 
-  build-alternative-jvm:
+  functional-extension-tests:
     runs-on: ubuntu-latest
     needs: build
     strategy:
       fail-fast: false
       matrix:
-        java: [ '8' , '14' ]
+        java: [ '11' ]
     env:
       MAVEN_OPTS: -Xmx3000m
     steps:
@@ -149,14 +148,101 @@ jobs:
           df -h /
           tar -xzf ../maven-repo.tgz -C ~
           df -h /
-      - name: Build on ${{ matrix.java }}
+      - name: cd extensions-core && mvn test
         run: |
-          ./mvnw -V -ntp ${BRANCH_OPTIONS} \
-            clean verify
-      - name: Fail if there are uncommitted changes
+          cd extensions-core
+          ../mvnw -V -ntp ${BRANCH_OPTIONS} \
+            -Dformatter.skip -Dimpsort.skip -Denforce=false -Dcamel-quarkus.update-extension-doc-page.skip \
+            test
+      - name: cd extensions && mvn test
+        run: |
+          cd extensions
+          ../mvnw -V -ntp ${BRANCH_OPTIONS} \
+            -Dformatter.skip -Dimpsort.skip -Denforce=false -Dcamel-quarkus.update-extension-doc-page.skip \
+            test
+
+  extensions-jvm-tests:
+    runs-on: ubuntu-latest
+    needs: build
+    strategy:
+      fail-fast: false
+      matrix:
+        java: [ '8' , '11', '14' ]
+    env:
+      MAVEN_OPTS: -Xmx3000m
+    steps:
+      - name: Setup apache-snapshots profile
+        if: github.ref == 'refs/heads/camel-master' || github.base_ref == 'camel-master'
+        run: |
+          echo '::set-env name=BRANCH_OPTIONS::-Papache-snapshots'
+      - name: Setup oss-snapshots profile
+        if: github.ref == 'refs/heads/quarkus-master' || github.base_ref == 'quarkus-master'
+        run: |
+          echo '::set-env name=BRANCH_OPTIONS::-Poss-snapshots -Dquarkus.version=999-SNAPSHOT'
+      - uses: actions/checkout@v2
+      - name: Set up JDK ${{ matrix.java }}
+        uses: AdoptOpenJDK/install-jdk@v1
+        with:
+          version: ${{ matrix.java }}
+      - name: Download Maven Repo
+        uses: actions/download-artifact@v1
+        with:
+          name: maven-repo
+          path: ..
+      - name: Extract Maven Repo
         shell: bash
         run: |
-          [[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; exit 1; }
+          df -h /
+          tar -xzf ../maven-repo.tgz -C ~
+          df -h /
+      - name: cd extensions-jvm && mvn clean test
+        run: |
+          cd extensions-jvm
+          ../mvnw -V -ntp ${BRANCH_OPTIONS} \
+            -Dformatter.skip -Dimpsort.skip -Denforce=false \
+            clean test
+
+  integration-tests-alternative-jvm:
+    runs-on: ubuntu-latest
+    needs: build
+    if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'JVM')
+    strategy:
+      fail-fast: false
+      matrix:
+        java: [ '8' , '14' ]
+    env:
+      MAVEN_OPTS: -Xmx3000m
+    steps:
+      - name: Setup apache-snapshots profile
+        if: github.ref == 'refs/heads/camel-master' || github.base_ref == 'camel-master'
+        run: |
+          echo '::set-env name=BRANCH_OPTIONS::-Papache-snapshots'
+      - name: Setup oss-snapshots profile
+        if: github.ref == 'refs/heads/quarkus-master' || github.base_ref == 'quarkus-master'
+        run: |
+          echo '::set-env name=BRANCH_OPTIONS::-Poss-snapshots -Dquarkus.version=999-SNAPSHOT'
+      - uses: actions/checkout@v2
+      - name: Set up JDK ${{ matrix.java }}
+        uses: AdoptOpenJDK/install-jdk@v1
+        with:
+          version: ${{ matrix.java }}
+      - name: Download Maven Repo
+        uses: actions/download-artifact@v1
+        with:
+          name: maven-repo
+          path: ..
+      - name: Extract Maven Repo
+        shell: bash
+        run: |
+          df -h /
+          tar -xzf ../maven-repo.tgz -C ~
+          df -h /
+      - name: cd integration-tests && mvn clean verify
+        run: |
+          cd integration-tests
+          ../mvnw -V -ntp ${BRANCH_OPTIONS} \
+            -Dformatter.skip -Dimpsort.skip -Denforce=false \
+            clean verify
 
   native-tests:
     name: Native Tests - ${{matrix.category}}
@@ -218,6 +304,7 @@ jobs:
           do modules+=("integration-tests/$i"); done
           IFS=,
           eval ./mvnw -V -ntp ${BRANCH_OPTIONS} clean verify \
+            -Dformatter.skip -Dimpsort.skip -Denforce=false \
             -Dnative \
             -Ddocker \
             -pl "${modules[*]}"
@@ -226,6 +313,55 @@ jobs:
         run: |
           [[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; exit 1; }
 
+  examples-tests:
+    needs: build
+    runs-on: ubuntu-latest
+    if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'JVM')
+    strategy:
+      fail-fast: false
+      matrix:
+        java: [ '8' , '11', '14' ]
+    steps:
+      - name: Setup apache-snapshots profile
+        if: github.ref == 'refs/heads/camel-master' || github.base_ref == 'camel-master'
+        run: |
+          echo '::set-env name=BRANCH_OPTIONS::-Papache-snapshots'
+      - name: Setup oss-snapshots profile
+        if: github.ref == 'refs/heads/quarkus-master' || github.base_ref == 'quarkus-master'
+        run: |
+          echo '::set-env name=BRANCH_OPTIONS::-Poss-snapshots -Dquarkus.version=999-SNAPSHOT'
+      - name: Activate native tests on Java 11
+        if: matrix.java == '11'
+        run: |
+          echo '::set-env name=MVN_TARGETS::-Pnative,docker clean verify'
+      - name: Do not activate native tests on Java non-11
+        if: matrix.java != '11'
+        run: |
+          echo '::set-env name=MVN_TARGETS::clean test'
+      - name: Checkout
+        uses: actions/checkout@v2
+      - name: Set up JDK 11
+        uses: AdoptOpenJDK/install-jdk@v1
+        with:
+          version: ${{ matrix.java }}
+      - name: Download Maven Repo
+        uses: actions/download-artifact@v1
+        with:
+          name: maven-repo
+          path: ..
+      - name: Extract Maven Repo
+        shell: bash
+        run: |
+          df -h /
+          tar -xzf ../maven-repo.tgz -C ~
+          df -h /
+      - name: cd examples && mvn clean test/verify
+        run: |
+          cd examples
+          ../mvnw -V -ntp ${BRANCH_OPTIONS} \
+            -Dformatter.skip -Dimpsort.skip -Denforce=false \
+            ${MVN_TARGETS}
+
   # memoryhogs:
   #   runs-on: ubuntu-latest
   #   needs: build


[camel-quarkus] 11/14: Clean google drive in google sheets itest

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 03e8e3beb47ed64ca231581c6c06855b4949685f
Author: Lukas Lowinger <ll...@redhat.com>
AuthorDate: Mon Aug 24 16:22:06 2020 +0200

    Clean google drive in google sheets itest
---
 .../quarkus/component/google/it/GoogleComponentsTest.java   | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/integration-tests/google/src/test/java/org/apache/camel/quarkus/component/google/it/GoogleComponentsTest.java b/integration-tests/google/src/test/java/org/apache/camel/quarkus/component/google/it/GoogleComponentsTest.java
index 2287945..ee0ba6f 100644
--- a/integration-tests/google/src/test/java/org/apache/camel/quarkus/component/google/it/GoogleComponentsTest.java
+++ b/integration-tests/google/src/test/java/org/apache/camel/quarkus/component/google/it/GoogleComponentsTest.java
@@ -231,5 +231,18 @@ class GoogleComponentsTest {
                 .then()
                 .statusCode(200)
                 .body(is(title + " Updated"));
+
+        // Delete sheet via google-drive component
+        RestAssured.given()
+                .queryParam("fileId", sheetId)
+                .delete("/google-drive/delete")
+                .then()
+                .statusCode(204);
+
+        RestAssured.given()
+                .queryParam("fileId", sheetId)
+                .get("/google-drive/read")
+                .then()
+                .statusCode(404);
     }
 }


[camel-quarkus] 13/14: Send unique messages in Slack itest to avoid false positive tests

Posted by pp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fc11bafe878b0b5a5a1ed2946d3c8dcaa3d23c9c
Author: Lukas Lowinger <ll...@redhat.com>
AuthorDate: Tue Aug 25 14:46:26 2020 +0200

    Send unique messages in Slack itest to avoid false positive tests
---
 .../camel/quarkus/component/slack/it/SlackResource.java   |  4 +++-
 .../camel/quarkus/component/slack/it/SlackTest.java       | 15 +++++++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/integration-tests/slack/src/main/java/org/apache/camel/quarkus/component/slack/it/SlackResource.java b/integration-tests/slack/src/main/java/org/apache/camel/quarkus/component/slack/it/SlackResource.java
index 8097bd5..38ff208 100644
--- a/integration-tests/slack/src/main/java/org/apache/camel/quarkus/component/slack/it/SlackResource.java
+++ b/integration-tests/slack/src/main/java/org/apache/camel/quarkus/component/slack/it/SlackResource.java
@@ -20,6 +20,7 @@ import java.net.URI;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
+import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
@@ -54,8 +55,9 @@ public class SlackResource {
 
     @Path("/message")
     @POST
+    @Consumes(MediaType.TEXT_PLAIN)
     public Response createSlackMessage(String message) throws Exception {
-        producerTemplate.requestBody("slack://general?" + SLACK_AUTH_PARAMS, "Hello Camel Quarkus Slack");
+        producerTemplate.requestBody("slack://general?" + SLACK_AUTH_PARAMS, message);
         return Response
                 .created(new URI("https://camel.apache.org/"))
                 .build();
diff --git a/integration-tests/slack/src/test/java/org/apache/camel/quarkus/component/slack/it/SlackTest.java b/integration-tests/slack/src/test/java/org/apache/camel/quarkus/component/slack/it/SlackTest.java
index 9bd4f4f..77877af 100644
--- a/integration-tests/slack/src/test/java/org/apache/camel/quarkus/component/slack/it/SlackTest.java
+++ b/integration-tests/slack/src/test/java/org/apache/camel/quarkus/component/slack/it/SlackTest.java
@@ -16,8 +16,11 @@
  */
 package org.apache.camel.quarkus.component.slack.it;
 
+import java.util.UUID;
+
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
 import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
@@ -39,13 +42,21 @@ class SlackTest {
 
     @Test
     public void testSlackProduceConsumeMessages() {
-        RestAssured.post("/slack/message")
+        final String message = "Hello Camel Quarkus Slack" + (externalSlackEnabled() ? " " + UUID.randomUUID() : "");
+        RestAssured.given()
+                .contentType(ContentType.TEXT)
+                .body(message)
+                .post("/slack/message")
                 .then()
                 .statusCode(201);
 
         RestAssured.get("/slack/messages")
                 .then()
                 .statusCode(200)
-                .body(equalTo("Hello Camel Quarkus Slack"));
+                .body(equalTo(message));
+    }
+
+    boolean externalSlackEnabled() {
+        return System.getenv("SLACK_WEBHOOK_URL") != null;
     }
 }