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 af96923 CAMEL-16400: split unit and integration tests for camel-google-storage (#5393) af96923 is described below commit af969235e616d0e6ee60265734bcc00ffc22ad40 Author: Otavio Rodolfo Piske <orpi...@users.noreply.github.com> AuthorDate: Fri Apr 16 15:11:31 2021 +0200 CAMEL-16400: split unit and integration tests for camel-google-storage (#5393) --- .../camel-google/camel-google-storage/ReadMe.md | 5 +- .../camel-google/camel-google-storage/pom.xml | 164 +++++++++------------ ...{ComplexIntegrationTest.java => ComplexIT.java} | 5 +- 3 files changed, 77 insertions(+), 97 deletions(-) diff --git a/components/camel-google/camel-google-storage/ReadMe.md b/components/camel-google/camel-google-storage/ReadMe.md index bbd2bed..efff1f1 100644 --- a/components/camel-google/camel-google-storage/ReadMe.md +++ b/components/camel-google/camel-google-storage/ReadMe.md @@ -33,11 +33,10 @@ or directly through the component endpoint `from("google-storage://myCamelBucket?serviceAccountKey=/home/user/Downloads/my-key.json")` - -Running tests against Storage instance: +Running integration tests will be automatically executed if the GOOGLE_APPLICATION_CREDENTIALS is exported, and the `verify` target is executed: ``` -mvn -Pgoogle-storage-test verify +mvn verify ``` diff --git a/components/camel-google/camel-google-storage/pom.xml b/components/camel-google/camel-google-storage/pom.xml index f716d9c..ad026fa 100644 --- a/components/camel-google/camel-google-storage/pom.xml +++ b/components/camel-google/camel-google-storage/pom.xml @@ -17,9 +17,10 @@ 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> @@ -27,99 +28,76 @@ <version>3.10.0-SNAPSHOT</version> </parent> - <artifactId>camel-google-storage</artifactId> - <packaging>jar</packaging> - <name>Camel :: Google Storage</name> - <description>For storing and accessing data on Google Cloud Platform</description> + <artifactId>camel-google-storage</artifactId> + <packaging>jar</packaging> + <name>Camel :: Google Storage</name> + <description>For storing and accessing data on Google Cloud Platform</description> - <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>libraries-bom</artifactId> - <version>${google-cloud-bom-version}</version> - <type>pom</type> - <scope>import</scope> - </dependency> - </dependencies> - </dependencyManagement> - - <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-storage</artifactId> - </dependency> - <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> + <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>libraries-bom</artifactId> + <version>${google-cloud-bom-version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> - </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> - <includes> - <include>**/unit/**/*.java</include> - </includes> - </configuration> - </plugin> - </plugins> - </build> + <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-storage</artifactId> + </dependency> + <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> - <profiles> - <profile> - <id>google-storage-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> + </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> + </plugin> + </plugins> + </build> </project> diff --git a/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIntegrationTest.java b/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIT.java similarity index 96% rename from components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIntegrationTest.java rename to components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIT.java index 3fa6a8c..cd0d279 100644 --- a/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIntegrationTest.java +++ b/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIT.java @@ -27,8 +27,11 @@ import org.apache.camel.component.google.storage.GoogleCloudStorageConstants; 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 ComplexIntegrationTest extends CamelTestSupport { +@EnabledIfEnvironmentVariable(named = "GOOGLE_APPLICATION_CREDENTIALS", matches = ".*", + disabledReason = "Application credentials were not provided") +public class ComplexIT extends CamelTestSupport { @EndpointInject private ProducerTemplate template;