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 b9c807f CAMEL-16400: split unit and integration tests for
camel-servicenow (#5429)
b9c807f is described below
commit b9c807f52f3604550a1b3279c88948b61d123645
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Mon Apr 19 17:59:19 2021 +0200
CAMEL-16400: split unit and integration tests for camel-servicenow (#5429)
---
.../camel-servicenow-component/pom.xml | 32 ++--------------------
...chmentTest.java => ServiceNowAttachmentIT.java} | 5 +++-
...=> ServiceNowComponentVerifierExtensionIT.java} | 7 +++--
...est.java => ServiceNowComponentVerifierIT.java} | 7 +++--
.../{ServiceNowTest.java => ServiceNowIT.java} | 5 +++-
...owTestSupport.java => ServiceNowITSupport.java} | 8 +++---
...portSetTest.java => ServiceNowImportSetIT.java} | 2 +-
...est.java => ServiceNowMetaDataExtensionIT.java} | 9 ++++--
...orecardTest.java => ServiceNowScorecardIT.java} | 5 +++-
...ogTest.java => ServiceNowServiceCatalogIT.java} | 5 +++-
...iceNowTableTest.java => ServiceNowTableIT.java} | 5 +++-
.../src/test/resources/log4j2.properties | 2 +-
12 files changed, 44 insertions(+), 48 deletions(-)
diff --git a/components/camel-servicenow/camel-servicenow-component/pom.xml
b/components/camel-servicenow/camel-servicenow-component/pom.xml
index 5f64875..c9a9a84 100644
--- a/components/camel-servicenow/camel-servicenow-component/pom.xml
+++ b/components/camel-servicenow/camel-servicenow-component/pom.xml
@@ -125,38 +125,10 @@
<build>
<plugins>
<plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
</build>
- <profiles>
- <profile>
- <id>servicenow-tests</id>
- <activation>
- <property>
- <name>env.SERVICENOW_INSTANCE</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>false</skipTests>
- <systemPropertyVariables>
-
<servicenow.instance>${env.SERVICENOW_INSTANCE}</servicenow.instance>
-
<servicenow.username>${env.SERVICENOW_USERNAME}</servicenow.username>
-
<servicenow.password>${env.SERVICENOW_PASSWORD}</servicenow.password>
- </systemPropertyVariables>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
</project>
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowAttachmentTest.java
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowAttachmentIT.java
similarity index 95%
rename from
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowAttachmentTest.java
rename to
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowAttachmentIT.java
index a9fc943..a1c00a9 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowAttachmentTest.java
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowAttachmentIT.java
@@ -27,6 +27,7 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.servicenow.model.AttachmentMeta;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import static
org.apache.camel.support.ResourceHelper.resolveResourceAsInputStream;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -34,7 +35,9 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class ServiceNowAttachmentTest extends ServiceNowTestSupport {
+@EnabledIfEnvironmentVariable(named = "SERVICENOW_INSTANCE", matches = ".*",
+ disabledReason = "Service now instance was not
provided")
+public class ServiceNowAttachmentIT extends ServiceNowITSupport {
@Produce("direct:servicenow")
ProducerTemplate template;
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierExtensionTest.java
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierExtensionIT.java
similarity index 95%
rename from
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierExtensionTest.java
rename to
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierExtensionIT.java
index cf3692b..b36c918 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierExtensionTest.java
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierExtensionIT.java
@@ -23,13 +23,16 @@ import javax.ws.rs.ProcessingException;
import org.apache.camel.Component;
import org.apache.camel.component.extension.ComponentVerifierExtension;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class ServiceNowComponentVerifierExtensionTest extends
ServiceNowTestSupport {
- public ServiceNowComponentVerifierExtensionTest() {
+@EnabledIfEnvironmentVariable(named = "SERVICENOW_INSTANCE", matches = ".*",
+ disabledReason = "Service now instance was not
provided")
+public class ServiceNowComponentVerifierExtensionIT extends
ServiceNowITSupport {
+ public ServiceNowComponentVerifierExtensionIT() {
super(false);
}
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierTest.java
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierIT.java
similarity index 95%
rename from
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierTest.java
rename to
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierIT.java
index 105204c..81b365a 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierTest.java
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowComponentVerifierIT.java
@@ -22,13 +22,16 @@ import javax.ws.rs.ProcessingException;
import org.apache.camel.component.extension.ComponentVerifierExtension;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class ServiceNowComponentVerifierTest extends ServiceNowTestSupport {
- public ServiceNowComponentVerifierTest() {
+@EnabledIfEnvironmentVariable(named = "SERVICENOW_INSTANCE", matches = ".*",
+ disabledReason = "Service now instance was not
provided")
+public class ServiceNowComponentVerifierIT extends ServiceNowITSupport {
+ public ServiceNowComponentVerifierIT() {
super(false);
}
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTest.java
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowIT.java
similarity index 97%
rename from
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTest.java
rename to
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowIT.java
index 41120f0..f2ffdf9 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTest.java
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowIT.java
@@ -31,6 +31,7 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.component.servicenow.model.Incident;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -38,7 +39,9 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class ServiceNowTest extends ServiceNowTestSupport {
+@EnabledIfEnvironmentVariable(named = "SERVICENOW_INSTANCE", matches = ".*",
+ disabledReason = "Service now instance was not
provided")
+public class ServiceNowIT extends ServiceNowITSupport {
@Test
public void testExceptions() {
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTestSupport.java
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowITSupport.java
similarity index 96%
rename from
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTestSupport.java
rename to
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowITSupport.java
index 38d07a8..ab1ec79 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTestSupport.java
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowITSupport.java
@@ -26,16 +26,16 @@ import org.apache.camel.util.ObjectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-class ServiceNowTestSupport extends CamelTestSupport {
- protected static final Logger LOGGER =
LoggerFactory.getLogger(ServiceNowTestSupport.class);
+class ServiceNowITSupport extends CamelTestSupport {
+ protected static final Logger LOGGER =
LoggerFactory.getLogger(ServiceNowITSupport.class);
private final boolean setUpComponent;
- ServiceNowTestSupport() {
+ ServiceNowITSupport() {
this(true);
}
- ServiceNowTestSupport(boolean setUpComponent) {
+ ServiceNowITSupport(boolean setUpComponent) {
this.setUpComponent = setUpComponent;
}
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowImportSetTest.java
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowImportSetIT.java
similarity index 98%
rename from
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowImportSetTest.java
rename to
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowImportSetIT.java
index 50cc28d..a17f892 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowImportSetTest.java
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowImportSetIT.java
@@ -41,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
* 1. Create a new web service named u_test_imp_incident targeting incident
table 2. Create a mapping (automatic)
*/
@Disabled
-public class ServiceNowImportSetTest extends ServiceNowTestSupport {
+public class ServiceNowImportSetIT extends ServiceNowITSupport {
@Test
public void testIncidentImport() throws Exception {
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowMetaDataExtensionTest.java
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowMetaDataExtensionIT.java
similarity index 92%
rename from
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowMetaDataExtensionTest.java
rename to
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowMetaDataExtensionIT.java
index 68b7fe0..49ec66c 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowMetaDataExtensionTest.java
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowMetaDataExtensionIT.java
@@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.camel.component.extension.MetaDataExtension;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -29,10 +30,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
-public class ServiceNowMetaDataExtensionTest extends ServiceNowTestSupport {
- private static final Logger LOGGER =
LoggerFactory.getLogger(ServiceNowMetaDataExtensionTest.class);
+@EnabledIfEnvironmentVariable(named = "SERVICENOW_INSTANCE", matches = ".*",
+ disabledReason = "Service now instance was not
provided")
+public class ServiceNowMetaDataExtensionIT extends ServiceNowITSupport {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(ServiceNowMetaDataExtensionIT.class);
- public ServiceNowMetaDataExtensionTest() {
+ public ServiceNowMetaDataExtensionIT() {
super(false);
}
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowScorecardTest.java
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowScorecardIT.java
similarity index 89%
rename from
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowScorecardTest.java
rename to
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowScorecardIT.java
index 5c5a079..445de99 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowScorecardTest.java
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowScorecardIT.java
@@ -23,10 +23,13 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.servicenow.model.Scorecard;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import static org.junit.jupiter.api.Assertions.assertFalse;
-public class ServiceNowScorecardTest extends ServiceNowTestSupport {
+@EnabledIfEnvironmentVariable(named = "SERVICENOW_INSTANCE", matches = ".*",
+ disabledReason = "Service now instance was not
provided")
+public class ServiceNowScorecardIT extends ServiceNowITSupport {
@Produce("direct:servicenow")
ProducerTemplate template;
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowServiceCatalogTest.java
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowServiceCatalogIT.java
similarity index 92%
rename from
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowServiceCatalogTest.java
rename to
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowServiceCatalogIT.java
index 059fbd8..8e449d0 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowServiceCatalogTest.java
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowServiceCatalogIT.java
@@ -24,11 +24,14 @@ import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
-public class ServiceNowServiceCatalogTest extends ServiceNowTestSupport {
+@EnabledIfEnvironmentVariable(named = "SERVICENOW_INSTANCE", matches = ".*",
+ disabledReason = "Service now instance was not
provided")
+public class ServiceNowServiceCatalogIT extends ServiceNowITSupport {
@Produce("direct:servicenow")
ProducerTemplate template;
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTableTest.java
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTableIT.java
similarity index 97%
rename from
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTableTest.java
rename to
components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTableIT.java
index c4c0972..7851222 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTableTest.java
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/java/org/apache/camel/component/servicenow/ServiceNowTableIT.java
@@ -27,6 +27,7 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.component.servicenow.model.Incident;
import org.apache.camel.component.servicenow.model.IncidentWithParms;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -34,7 +35,9 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class ServiceNowTableTest extends ServiceNowTestSupport {
+@EnabledIfEnvironmentVariable(named = "SERVICENOW_INSTANCE", matches = ".*",
+ disabledReason = "Service now instance was not
provided")
+public class ServiceNowTableIT extends ServiceNowITSupport {
@Test
public void testRetrieveSome() throws Exception {
diff --git
a/components/camel-servicenow/camel-servicenow-component/src/test/resources/log4j2.properties
b/components/camel-servicenow/camel-servicenow-component/src/test/resources/log4j2.properties
index d412256..081f94c 100644
---
a/components/camel-servicenow/camel-servicenow-component/src/test/resources/log4j2.properties
+++
b/components/camel-servicenow/camel-servicenow-component/src/test/resources/log4j2.properties
@@ -29,7 +29,7 @@ appender.out.layout.pattern = %d{HH:mm:ss.SSS} [%-15.15t]
%-30.30c{1} %-5p %m%n
logger.servicenow.name = org.apache.camel.component.servicenow
logger.servicenow.level = DEBUG
-logger.metadata.name =
org.apache.camel.component.servicenow.ServiceNowMetaDataExtensionTest
+logger.metadata.name =
org.apache.camel.component.servicenow.ServiceNowMetaDataExtensionIT
logger.metadata.level = DEBUG
#logger.metadata.additivity = true
#logger.metadata.appenderRef.metadata.ref = out