You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2021/04/16 10:51:57 UTC

[camel] branch master updated: CAMEL-16400: split unit and integration tests for camel-google-functions (#5389)

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

orpiske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new e09edcf  CAMEL-16400: split unit and integration tests for camel-google-functions (#5389)
e09edcf is described below

commit e09edcfaa0126705345328c1bd57177b6866ffb6
Author: Otavio Rodolfo Piske <or...@users.noreply.github.com>
AuthorDate: Fri Apr 16 12:51:01 2021 +0200

    CAMEL-16400: split unit and integration tests for camel-google-functions (#5389)
---
 .../camel-google/camel-google-functions/ReadMe.md  |   2 +-
 .../camel-google/camel-google-functions/pom.xml    | 211 ++++++++++-----------
 .../{IntegrationTest.java => GoogleCloudIT.java}   |   5 +-
 3 files changed, 103 insertions(+), 115 deletions(-)

diff --git a/components/camel-google/camel-google-functions/ReadMe.md b/components/camel-google/camel-google-functions/ReadMe.md
index 6aa6aa3..9256133 100644
--- a/components/camel-google/camel-google-functions/ReadMe.md
+++ b/components/camel-google/camel-google-functions/ReadMe.md
@@ -33,7 +33,7 @@ or directly through the component endpoint
 Running tests against Google Functions instance:
 
 ```
-mvn -Pgoogle-functions-test verify
+mvn verify
 ```
 
 
diff --git a/components/camel-google/camel-google-functions/pom.xml b/components/camel-google/camel-google-functions/pom.xml
index b23d6a4..6556ed8 100644
--- a/components/camel-google/camel-google-functions/pom.xml
+++ b/components/camel-google/camel-google-functions/pom.xml
@@ -17,127 +17,112 @@
     limitations under the License.
 
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
-  <modelVersion>4.0.0</modelVersion>
+    <modelVersion>4.0.0</modelVersion>
 
-  <parent>
-    <groupId>org.apache.camel</groupId>
-    <artifactId>camel-google-parent</artifactId>
-    <version>3.10.0-SNAPSHOT</version>
-  </parent>
+    <parent>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-google-parent</artifactId>
+        <version>3.10.0-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>camel-google-functions</artifactId>
-  <packaging>jar</packaging>
-  <name>Camel :: Google Functions</name>
-  <description>Camel Component for Google Cloud Platform Functions</description>
+    <artifactId>camel-google-functions</artifactId>
+    <packaging>jar</packaging>
+    <name>Camel :: Google Functions</name>
+    <description>Camel Component for Google Cloud Platform Functions</description>
 
-  <properties>
-    <firstVersion>3.9.0</firstVersion>
-  </properties>
+    <properties>
+        <firstVersion>3.9.0</firstVersion>
+    </properties>
 
-  <dependencyManagement>
-    <dependencies>
-      <!-- Override the android JDK 7 guava in libraries-bom -->
-      <dependency>
-        <groupId>com.google.guava</groupId>
-        <artifactId>guava</artifactId>
-        <version>${google-cloud-guava-version}</version>
-      </dependency>
-      <dependency>
-        <groupId>com.google.cloud</groupId>
-        <artifactId>google-cloud-functions-bom</artifactId>
-        <version>${google-cloud-functions-bom-version}</version>
-        <type>pom</type>
-        <scope>import</scope>
-      </dependency>
-    </dependencies>
-  
-  </dependencyManagement>
+    <dependencyManagement>
+        <dependencies>
+            <!-- Override the android JDK 7 guava in libraries-bom -->
+            <dependency>
+                <groupId>com.google.guava</groupId>
+                <artifactId>guava</artifactId>
+                <version>${google-cloud-guava-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.google.cloud</groupId>
+                <artifactId>google-cloud-functions-bom</artifactId>
+                <version>${google-cloud-functions-bom-version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.camel</groupId>
-      <artifactId>camel-support</artifactId>
-    </dependency>
-    
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.google.cloud</groupId>
-      <artifactId>google-cloud-functions</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.google.api.grpc</groupId>
-      <artifactId>grpc-google-cloud-functions-v1</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.api</groupId>
-      <artifactId>gax-grpc</artifactId>
-      <classifier>testlib</classifier>
-      <version>${google-cloud-functions-gax-grpc-version}</version>
-      <scope>test</scope>
-    </dependency>
+    </dependencyManagement>
 
-    <dependency>
-      <groupId>org.apache.camel</groupId>
-      <artifactId>camel-test-junit5</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-slf4j-impl</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-junit-jupiter</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-support</artifactId>
+        </dependency>
 
-  <build>
-    <plugins>
-      <plugin>
-          <artifactId>maven-surefire-plugin</artifactId>
-          <configuration>
-              <childDelegation>false</childDelegation>
-              <useFile>true</useFile>
-              <forkCount>1</forkCount>
-              <reuseForks>true</reuseForks>
-              <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
-              <includes>
-                  <include>**/unit/**/*.java</include>
-              </includes>
-          </configuration>
-      </plugin>
-    </plugins>
-  </build>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.cloud</groupId>
+            <artifactId>google-cloud-functions</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.api.grpc</groupId>
+            <artifactId>grpc-google-cloud-functions-v1</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.api</groupId>
+            <artifactId>gax-grpc</artifactId>
+            <classifier>testlib</classifier>
+            <version>${google-cloud-functions-gax-grpc-version}</version>
+            <scope>test</scope>
+        </dependency>
 
-  <profiles>
-    <profile>
-        <id>google-functions-test</id>
-        <build>
-            <plugins>
-                <plugin>
-                    <artifactId>maven-surefire-plugin</artifactId>
-                    <configuration>
-                        <childDelegation>false</childDelegation>
-                        <useFile>true</useFile>
-                        <forkCount>1</forkCount>
-                        <reuseForks>true</reuseForks>
-                        <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
-                        <includes>
-                            <include>**/*Test.java</include>
-                        </includes>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </build>
-    </profile>
-</profiles>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-junit5</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-junit-jupiter</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <childDelegation>false</childDelegation>
+                    <useFile>true</useFile>
+                    <forkCount>1</forkCount>
+                    <reuseForks>true</reuseForks>
+                    <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <configuration>
+                    <childDelegation>false</childDelegation>
+                    <useFile>true</useFile>
+                    <forkCount>1</forkCount>
+                    <reuseForks>true</reuseForks>
+                    <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/components/camel-google/camel-google-functions/src/test/java/org/apache/camel/component/google/functions/integration/IntegrationTest.java b/components/camel-google/camel-google-functions/src/test/java/org/apache/camel/component/google/functions/integration/GoogleCloudIT.java
similarity index 95%
rename from components/camel-google/camel-google-functions/src/test/java/org/apache/camel/component/google/functions/integration/IntegrationTest.java
rename to components/camel-google/camel-google-functions/src/test/java/org/apache/camel/component/google/functions/integration/GoogleCloudIT.java
index 92f989b..6f8911b 100644
--- a/components/camel-google/camel-google-functions/src/test/java/org/apache/camel/component/google/functions/integration/IntegrationTest.java
+++ b/components/camel-google/camel-google-functions/src/test/java/org/apache/camel/component/google/functions/integration/GoogleCloudIT.java
@@ -25,8 +25,11 @@ import org.apache.camel.component.google.functions.GoogleCloudFunctionsConstants
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
 
-public class IntegrationTest extends CamelTestSupport {
+@EnabledIfEnvironmentVariable(named = "GOOGLE_APPLICATION_CREDENTIALS", matches = ".*",
+                              disabledReason = "Application credentials were not provided")
+public class GoogleCloudIT extends CamelTestSupport {
 
     final String functionNameReverseString = "function-reverse-string";
     final String serviceAccountKeyFile = System.getenv("GOOGLE_APPLICATION_CREDENTIALS");