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 13:12:43 UTC

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

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 0a33d76  CAMEL-16400: split unit and integration tests for camel-stitch (#5396)
0a33d76 is described below

commit 0a33d76b8111e4e6decc27370918dd05c59fc62f
Author: Otavio Rodolfo Piske <or...@users.noreply.github.com>
AuthorDate: Fri Apr 16 15:11:48 2021 +0200

    CAMEL-16400: split unit and integration tests for camel-stitch (#5396)
---
 components/camel-stitch/pom.xml                    | 37 +++++-----------------
 .../camel/component/stitch/StitchTestUtils.java    |  2 +-
 .../{ => integration}/StitchClientImplIT.java      |  7 +++-
 .../stitch/{ => integration}/StitchProducerIT.java |  5 ++-
 .../StitchProducerOperationsIT.java                |  5 ++-
 5 files changed, 23 insertions(+), 33 deletions(-)

diff --git a/components/camel-stitch/pom.xml b/components/camel-stitch/pom.xml
index 08db7d9..be12589 100644
--- a/components/camel-stitch/pom.xml
+++ b/components/camel-stitch/pom.xml
@@ -81,33 +81,12 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
-    <profiles>
-        <profile>
-            <id>fullTests</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <artifactId>maven-surefire-plugin</artifactId>
-                        <version>${maven-surefire-plugin-version}</version>
-                        <executions>
-                            <execution>
-                                <phase>integration-test</phase>
-                                <goals>
-                                    <goal>test</goal>
-                                </goals>
-                                <configuration>
-                                    <excludes>
-                                        <exclude>none</exclude>
-                                    </excludes>
-                                    <includes>
-                                        <include>**/*IT</include>
-                                    </includes>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/StitchTestUtils.java b/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/StitchTestUtils.java
index 5a83397..0699ce4 100644
--- a/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/StitchTestUtils.java
+++ b/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/StitchTestUtils.java
@@ -27,7 +27,7 @@ public final class StitchTestUtils {
         final Properties properties = new Properties();
         if (System.getProperty("token") == null) {
             throw new Exception(
-                    "Make sure to supply Stitch token, e.g:  mvn verify -PfullTests -Dtoken=mytoken");
+                    "Make sure to supply Stitch token, e.g:  mvn verify -Dtoken=mytoken");
         }
         properties.setProperty("token", System.getProperty("token"));
 
diff --git a/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/client/StitchClientImplIT.java b/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/client/integration/StitchClientImplIT.java
similarity index 91%
rename from components/camel-stitch/src/test/java/org/apache/camel/component/stitch/client/StitchClientImplIT.java
rename to components/camel-stitch/src/test/java/org/apache/camel/component/stitch/client/integration/StitchClientImplIT.java
index bfc61b0..9a4a936 100644
--- a/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/client/StitchClientImplIT.java
+++ b/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/client/integration/StitchClientImplIT.java
@@ -14,25 +14,30 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.stitch.client;
+package org.apache.camel.component.stitch.client.integration;
 
 import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
 import org.apache.camel.component.stitch.StitchTestUtils;
+import org.apache.camel.component.stitch.client.StitchClient;
+import org.apache.camel.component.stitch.client.StitchClientBuilder;
+import org.apache.camel.component.stitch.client.StitchRegion;
 import org.apache.camel.component.stitch.client.models.StitchException;
 import org.apache.camel.component.stitch.client.models.StitchMessage;
 import org.apache.camel.component.stitch.client.models.StitchRequestBody;
 import org.apache.camel.component.stitch.client.models.StitchResponse;
 import org.apache.camel.component.stitch.client.models.StitchSchema;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 import reactor.core.publisher.Mono;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
+@EnabledIfSystemProperty(named = "token", matches = ".*", disabledReason = "Stitch token was not provided")
 class StitchClientImplIT {
 
     @Test
diff --git a/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/StitchProducerIT.java b/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/integration/StitchProducerIT.java
similarity index 95%
rename from components/camel-stitch/src/test/java/org/apache/camel/component/stitch/StitchProducerIT.java
rename to components/camel-stitch/src/test/java/org/apache/camel/component/stitch/integration/StitchProducerIT.java
index c7d02ee..1221b2f 100644
--- a/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/StitchProducerIT.java
+++ b/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/integration/StitchProducerIT.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.stitch;
+package org.apache.camel.component.stitch.integration;
 
 import java.util.Collections;
 import java.util.LinkedHashMap;
@@ -28,15 +28,18 @@ import org.apache.camel.Message;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.stitch.StitchConstants;
 import org.apache.camel.component.stitch.client.models.StitchMessage;
 import org.apache.camel.component.stitch.client.models.StitchRequestBody;
 import org.apache.camel.component.stitch.client.models.StitchSchema;
 import org.apache.camel.support.DefaultExchange;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
+@EnabledIfSystemProperty(named = "token", matches = ".*", disabledReason = "Stitch token was not provided")
 class StitchProducerIT extends CamelTestSupport {
 
     @EndpointInject
diff --git a/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/operations/StitchProducerOperationsIT.java b/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/operations/integration/StitchProducerOperationsIT.java
similarity index 95%
rename from components/camel-stitch/src/test/java/org/apache/camel/component/stitch/operations/StitchProducerOperationsIT.java
rename to components/camel-stitch/src/test/java/org/apache/camel/component/stitch/operations/integration/StitchProducerOperationsIT.java
index f3deaf5..2394d21 100644
--- a/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/operations/StitchProducerOperationsIT.java
+++ b/components/camel-stitch/src/test/java/org/apache/camel/component/stitch/operations/integration/StitchProducerOperationsIT.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.stitch.operations;
+package org.apache.camel.component.stitch.operations.integration;
 
 import java.util.Collections;
 import java.util.LinkedHashMap;
@@ -35,10 +35,12 @@ import org.apache.camel.component.stitch.client.models.StitchMessage;
 import org.apache.camel.component.stitch.client.models.StitchRequestBody;
 import org.apache.camel.component.stitch.client.models.StitchResponse;
 import org.apache.camel.component.stitch.client.models.StitchSchema;
+import org.apache.camel.component.stitch.operations.StitchProducerOperations;
 import org.apache.camel.support.DefaultExchange;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import reactor.core.publisher.Mono;
@@ -46,6 +48,7 @@ import reactor.core.publisher.Mono;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
+@EnabledIfSystemProperty(named = "token", matches = ".*", disabledReason = "Stitch token was not provided")
 class StitchProducerOperationsIT extends CamelTestSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(StitchProducerOperationsIT.class);