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/19 13:11:40 UTC

[camel] branch master updated: CAMEL-16400: split unit and integration tests for camel-telegram (#5423)

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 00edb83  CAMEL-16400: split unit and integration tests for camel-telegram (#5423)
00edb83 is described below

commit 00edb8316745405282551e8daaaf15a3073fc025
Author: Otavio Rodolfo Piske <or...@users.noreply.github.com>
AuthorDate: Mon Apr 19 15:11:10 2021 +0200

    CAMEL-16400: split unit and integration tests for camel-telegram (#5423)
---
 components/camel-telegram/pom.xml                  | 34 ++++------------------
 ...gramServiceTest.java => TelegramServiceIT.java} |  4 ++-
 ...eProxyTest.java => TelegramServiceProxyIT.java} |  4 ++-
 3 files changed, 11 insertions(+), 31 deletions(-)

diff --git a/components/camel-telegram/pom.xml b/components/camel-telegram/pom.xml
index c3c45b9..1b5a77f3 100644
--- a/components/camel-telegram/pom.xml
+++ b/components/camel-telegram/pom.xml
@@ -103,38 +103,14 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <includes>
-                        <include>**/org/apache/camel/component/telegram/*.java</include>
-                    </includes>
-                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
             </plugin>
         </plugins>
     </build>
 
-    <profiles>
-        <profile>
-            <id>telegram-integration-tests</id>
-            <activation>
-                <property>
-                    <name>env.TELEGRAM_AUTHORIZATION_TOKEN</name>
-                </property>
-                <!-- Also env.TELEGRAM_CHAT_ID is needed by the tests -->
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <artifactId>maven-surefire-plugin</artifactId>
-                        <configuration>
-                            <includes>
-                                <include>**/org/apache/camel/component/telegram/**/*.java</include>
-                            </includes>
-                        </configuration>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
-
 </project>
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceIT.java
similarity index 99%
rename from components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceTest.java
rename to components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceIT.java
index 831f562..5cf2b62 100644
--- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceTest.java
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceIT.java
@@ -57,10 +57,12 @@ import org.apache.camel.component.telegram.util.TelegramTestSupport;
 import org.apache.camel.component.telegram.util.TelegramTestUtil;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
 
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-public class TelegramServiceTest extends TelegramTestSupport {
+@EnabledIfEnvironmentVariable(named = "TELEGRAM_AUTHORIZATION_TOKEN", matches = ".*")
+public class TelegramServiceIT extends TelegramTestSupport {
 
     protected TelegramApiConfig getTelegramApiConfig() {
         return TelegramApiConfig.fromEnv();
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceProxyTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceProxyIT.java
similarity index 91%
rename from components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceProxyTest.java
rename to components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceProxyIT.java
index 5a17cd0..c36dc31 100644
--- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceProxyTest.java
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceProxyIT.java
@@ -22,10 +22,12 @@ import org.apache.camel.component.telegram.util.TelegramApiConfig;
 import org.apache.camel.component.telegram.util.TelegramTestSupport;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
 
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-public class TelegramServiceProxyTest extends TelegramTestSupport {
+@EnabledIfEnvironmentVariable(named = "TELEGRAM_AUTHORIZATION_TOKEN", matches = ".*")
+public class TelegramServiceProxyIT extends TelegramTestSupport {
 
     private static String proxyHost;
     private static String proxyPort;