This is an automated email from the ASF dual-hosted git repository. davsclaus 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 2484f42 CAMEL-16400: split unit and integration tests for camel-braintree (#5377) 2484f42 is described below commit 2484f42449ffbb349f8a561e9e07e6640db3106c Author: Otavio Rodolfo Piske <orpi...@users.noreply.github.com> AuthorDate: Thu Apr 15 14:37:36 2021 +0200 CAMEL-16400: split unit and integration tests for camel-braintree (#5377) --- components/camel-braintree/README.md | 19 +++++- components/camel-braintree/pom.xml | 72 ++++------------------ .../AddOnGatewayIT.java} | 9 ++- .../AddressGatewayIT.java} | 11 ++-- .../ClientTokenGatewayIT.java} | 7 ++- .../CreditCardVerificationGatewayIT.java} | 9 ++- .../CustomerGatewayIT.java} | 9 ++- .../DiscountGatewayIT.java} | 9 ++- .../DisputeGatewayIT.java} | 9 ++- .../DocumentUploadGatewayIT.java} | 9 ++- .../MerchantAccountGatewayIT.java} | 7 ++- .../PaymentMethodGatewayIT.java} | 11 ++-- .../PaymentMethodNonceGatewayIT.java} | 9 ++- .../PlanGatewayIT.java} | 9 ++- .../ReportGatewayIT.java} | 9 ++- .../SettlementBatchSummaryGatewayIT.java} | 9 ++- .../SubscriptionGatewayIT.java} | 9 ++- .../TransactionGatewayIT.java} | 11 ++-- .../WebhookNotificationGatewayIT.java} | 8 ++- .../src/test/resources/test-options.properties | 4 +- 20 files changed, 134 insertions(+), 115 deletions(-) diff --git a/components/camel-braintree/README.md b/components/camel-braintree/README.md index 605ed44..ef50635 100644 --- a/components/camel-braintree/README.md +++ b/components/camel-braintree/README.md @@ -18,10 +18,25 @@ privateKey = private key from sandbox ui Then, you can use the following commands to run the tests: ``` -CAMEL_BRAINTREE_REPORT_DATE=$(date '+%Y-%m-%d') CAMEL_BRAINTREE_MERCHANT_ACCOUNT_ID="merchant ID taken from sandbox" ui mvn -Pbraintree-test clean verify +CAMEL_BRAINTREE_REPORT_DATE=$(date '+%Y-%m-%d') CAMEL_BRAINTREE_MERCHANT_ACCOUNT_ID="merchant ID taken from sandbox" ui mvn mvn -DbraintreeAuthenticationType=PUBLIC_PRIVATE_KEYS clean verify ``` It's also possible to run a smaller set of tests by running them without the environment variables: ``` -mvn -Pbraintree-test clean verify +mvn -DbraintreeAuthenticationType=PUBLIC_PRIVATE_KEYS clean verify +``` + +# Authentication types + +The authentication type can be passed via `braintreeAuthenticationType` system property. +You can use one of: + +* PUBLIC_PRIVATE_KEYS +* ACCESS_TOKEN + + +I.e.: + +``` +mvn -DbraintreeAuthenticationType=ACCESS_TOKEN clean verify ``` diff --git a/components/camel-braintree/pom.xml b/components/camel-braintree/pom.xml index 28f75e5..d253f37 100644 --- a/components/camel-braintree/pom.xml +++ b/components/camel-braintree/pom.xml @@ -290,6 +290,18 @@ </executions> </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> <pluginManagement> @@ -306,65 +318,5 @@ </plugin> </plugins> </pluginManagement> - </build> - - <profiles> - <profile> - <id>braintree-test</id> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <systemPropertyVariables> - <braintreeAuthenticationType>PUBLIC_PRIVATE_KEYS</braintreeAuthenticationType> - </systemPropertyVariables> - <childDelegation>false</childDelegation> - <useFile>true</useFile> - <forkCount>1</forkCount> - <reuseForks>true</reuseForks> - <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds> - <includes> - <include>**/*Test.java</include> - </includes> - <excludes> - <exclude>**/*XXXTest.java</exclude> - </excludes> - </configuration> - </plugin> - </plugins> - </build> - </profile> - - <profile> - <id>braintree-access-token-test</id> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <systemPropertyVariables> - <braintreeAuthenticationType>ACCESS_TOKEN</braintreeAuthenticationType> - </systemPropertyVariables> - <childDelegation>false</childDelegation> - <useFile>true</useFile> - <forkCount>1</forkCount> - <reuseForks>true</reuseForks> - <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds> - <includes> - <include>**/*Test.java</include> - </includes> - <excludes> - <exclude>**/*XXXTest.java</exclude> - </excludes> - </configuration> - </plugin> - </plugins> - </build> - </profile> - </profiles> - </project> diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/AddOnGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/AddOnGatewayIT.java similarity index 84% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/AddOnGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/AddOnGatewayIT.java index 3654128..ace9e74 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/AddOnGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/AddOnGatewayIT.java @@ -14,23 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.util.List; import com.braintreegateway.AddOn; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.AddOnGatewayApiMethod; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; -public class AddOnGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class AddOnGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(AddOnGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(AddOnGatewayIT.class); private static final String PATH_PREFIX = getApiNameAsString(AddOnGatewayApiMethod.class); @Disabled diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/AddressGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/AddressGatewayIT.java similarity index 95% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/AddressGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/AddressGatewayIT.java index 72ac083..5093d37 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/AddressGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/AddressGatewayIT.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.util.LinkedList; import java.util.List; @@ -27,18 +27,21 @@ import com.braintreegateway.Customer; import com.braintreegateway.CustomerRequest; import com.braintreegateway.Result; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.AddressGatewayApiMethod; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class AddressGatewayIntegrationTest extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(AddressGatewayIntegrationTest.class); +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class AddressGatewayIT extends AbstractBraintreeTestSupport { + private static final Logger LOG = LoggerFactory.getLogger(AddressGatewayIT.class); private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(AddressGatewayApiMethod.class).getName(); @@ -50,7 +53,7 @@ public class AddressGatewayIntegrationTest extends AbstractBraintreeTestSupport // // ************************************************************************* - public AddressGatewayIntegrationTest() { + public AddressGatewayIT() { this.customer = null; this.gateway = null; this.addressIds = new LinkedList<>(); diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/ClientTokenGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/ClientTokenGatewayIT.java similarity index 82% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/ClientTokenGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/ClientTokenGatewayIT.java index f674792..c7f67e9 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/ClientTokenGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/ClientTokenGatewayIT.java @@ -14,16 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.ClientTokenGatewayApiMethod; import org.apache.camel.util.ObjectHelper; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import static org.junit.jupiter.api.Assertions.assertTrue; -public class ClientTokenGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class ClientTokenGatewayIT extends AbstractBraintreeTestSupport { private static final String PATH_PREFIX = getApiNameAsString(ClientTokenGatewayApiMethod.class); @Test diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/CreditCardVerificationGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/CreditCardVerificationGatewayIT.java similarity index 87% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/CreditCardVerificationGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/CreditCardVerificationGatewayIT.java index 4f67b69..70ea600 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/CreditCardVerificationGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/CreditCardVerificationGatewayIT.java @@ -14,23 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import com.braintreegateway.CreditCardVerification; import com.braintreegateway.ResourceCollection; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.CreditCardVerificationGatewayApiMethod; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; -public class CreditCardVerificationGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class CreditCardVerificationGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(CreditCardVerificationGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(CreditCardVerificationGatewayIT.class); private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(CreditCardVerificationGatewayApiMethod.class).getName(); diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/CustomerGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/CustomerGatewayIT.java similarity index 95% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/CustomerGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/CustomerGatewayIT.java index eba5917..49891f1 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/CustomerGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/CustomerGatewayIT.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.util.HashMap; import java.util.UUID; @@ -30,8 +30,10 @@ import com.braintreegateway.ValidationErrors; import com.braintreegateway.exceptions.NotFoundException; import org.apache.camel.CamelExecutionException; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.CustomerGatewayApiMethod; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,10 +45,11 @@ 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 CustomerGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class CustomerGatewayIT extends AbstractBraintreeTestSupport { private static final String PATH_PREFIX = getApiNameAsString(CustomerGatewayApiMethod.class); - private static final Logger LOG = LoggerFactory.getLogger(CustomerGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(CustomerGatewayIT.class); /** * Customers management workflow: - create a customer - lookup by id - update first name - delete by id - confirm diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/DiscountGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/DiscountGatewayIT.java similarity index 84% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/DiscountGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/DiscountGatewayIT.java index f348ed9..d44f5b1 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/DiscountGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/DiscountGatewayIT.java @@ -14,24 +14,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.util.List; import com.braintreegateway.Discount; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.DiscountGatewayApiMethod; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; -public class DiscountGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class DiscountGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(DiscountGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(DiscountGatewayIT.class); private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(DiscountGatewayApiMethod.class).getName(); diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/DisputeGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/DisputeGatewayIT.java similarity index 97% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/DisputeGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/DisputeGatewayIT.java index 12946b1..8496d6a 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/DisputeGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/DisputeGatewayIT.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.io.File; import java.math.BigDecimal; @@ -35,11 +35,13 @@ import com.braintreegateway.TextEvidenceRequest; import com.braintreegateway.Transaction; import com.braintreegateway.TransactionRequest; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.DisputeGatewayApiMethod; import org.apache.camel.component.braintree.internal.DocumentUploadGatewayApiMethod; import org.apache.camel.component.braintree.internal.TransactionGatewayApiMethod; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,9 +50,10 @@ 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 DisputeGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class DisputeGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(DisputeGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(DisputeGatewayIT.class); private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(DisputeGatewayApiMethod.class).getName(); private static final String TRANSACTION_PATH_PREFIX diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/DocumentUploadGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/DocumentUploadGatewayIT.java similarity index 87% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/DocumentUploadGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/DocumentUploadGatewayIT.java index 809dc2e..896a836 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/DocumentUploadGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/DocumentUploadGatewayIT.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.io.File; @@ -22,9 +22,11 @@ import com.braintreegateway.DocumentUpload; import com.braintreegateway.DocumentUploadRequest; import com.braintreegateway.Result; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.DocumentUploadGatewayApiMethod; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,9 +34,10 @@ 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 DocumentUploadGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class DocumentUploadGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(DocumentUploadGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(DocumentUploadGatewayIT.class); private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(DocumentUploadGatewayApiMethod.class).getName(); diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/MerchantAccountGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/MerchantAccountGatewayIT.java similarity index 92% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/MerchantAccountGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/MerchantAccountGatewayIT.java index 81d50f8..d6554a6 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/MerchantAccountGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/MerchantAccountGatewayIT.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.util.HashMap; import java.util.Map; @@ -24,16 +24,19 @@ import com.braintreegateway.MerchantAccount; import com.braintreegateway.MerchantAccountRequest; import com.braintreegateway.Result; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.BraintreeConstants; import org.apache.camel.component.braintree.internal.MerchantAccountGatewayApiMethod; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class MerchantAccountGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class MerchantAccountGatewayIT extends AbstractBraintreeTestSupport { private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(MerchantAccountGatewayApiMethod.class).getName(); diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PaymentMethodGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/PaymentMethodGatewayIT.java similarity index 95% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PaymentMethodGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/PaymentMethodGatewayIT.java index 2ecd94f..cfdacdc 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PaymentMethodGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/PaymentMethodGatewayIT.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.util.LinkedList; import java.util.List; @@ -27,18 +27,21 @@ import com.braintreegateway.PaymentMethod; import com.braintreegateway.PaymentMethodRequest; import com.braintreegateway.Result; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.PaymentMethodGatewayApiMethod; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class PaymentMethodGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class PaymentMethodGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(PaymentMethodGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(PaymentMethodGatewayIT.class); private static final String PATH_PREFIX = getApiNameAsString(PaymentMethodGatewayApiMethod.class); private BraintreeGateway gateway; @@ -49,7 +52,7 @@ public class PaymentMethodGatewayIntegrationTest extends AbstractBraintreeTestSu // // ************************************************************************* - public PaymentMethodGatewayIntegrationTest() { + public PaymentMethodGatewayIT() { this.customer = null; this.gateway = null; this.paymentMethodsTokens = new LinkedList<>(); diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PaymentMethodNonceGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/PaymentMethodNonceGatewayIT.java similarity index 87% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PaymentMethodNonceGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/PaymentMethodNonceGatewayIT.java index 54f8358..4a74067 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PaymentMethodNonceGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/PaymentMethodNonceGatewayIT.java @@ -14,21 +14,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.PaymentMethodNonceGatewayApiMethod; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; -public class PaymentMethodNonceGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class PaymentMethodNonceGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(PaymentMethodNonceGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(PaymentMethodNonceGatewayIT.class); private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(PaymentMethodNonceGatewayApiMethod.class).getName(); diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PlanGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/PlanGatewayIT.java similarity index 84% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PlanGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/PlanGatewayIT.java index 5a190f0..3c1cc21 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/PlanGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/PlanGatewayIT.java @@ -14,23 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.util.List; import com.braintreegateway.Plan; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.PlanGatewayApiMethod; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; -public class PlanGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class PlanGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(PlanGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(PlanGatewayIT.class); private static final String PATH_PREFIX = getApiNameAsString(PlanGatewayApiMethod.class); @Disabled diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/ReportGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/ReportGatewayIT.java similarity index 90% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/ReportGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/ReportGatewayIT.java index ea6a845..cfb1f87 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/ReportGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/ReportGatewayIT.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -22,11 +22,13 @@ import java.util.Calendar; import com.braintreegateway.TransactionLevelFeeReport; import com.braintreegateway.TransactionLevelFeeReportRequest; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.ReportGatewayApiMethod; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariables; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,9 +38,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** * Test class for {@link com.braintreegateway.ReportGateway} APIs. */ -public class ReportGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class ReportGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(ReportGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(ReportGatewayIT.class); private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(ReportGatewayApiMethod.class).getName(); diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/SettlementBatchSummaryGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/SettlementBatchSummaryGatewayIT.java similarity index 88% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/SettlementBatchSummaryGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/SettlementBatchSummaryGatewayIT.java index f15bf21..59d9f96 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/SettlementBatchSummaryGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/SettlementBatchSummaryGatewayIT.java @@ -14,24 +14,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.util.HashMap; import java.util.Map; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.SettlementBatchSummaryGatewayApiMethod; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; -public class SettlementBatchSummaryGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class SettlementBatchSummaryGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(SettlementBatchSummaryGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(SettlementBatchSummaryGatewayIT.class); private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(SettlementBatchSummaryGatewayApiMethod.class).getName(); diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/SubscriptionGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/SubscriptionGatewayIT.java similarity index 94% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/SubscriptionGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/SubscriptionGatewayIT.java index 6f4af37..e9626b1 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/SubscriptionGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/SubscriptionGatewayIT.java @@ -14,24 +14,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.util.HashMap; import java.util.Map; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.SubscriptionGatewayApiMethod; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; -public class SubscriptionGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class SubscriptionGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(SubscriptionGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(SubscriptionGatewayIT.class); private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(SubscriptionGatewayApiMethod.class).getName(); diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/TransactionGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/TransactionGatewayIT.java similarity index 98% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/TransactionGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/TransactionGatewayIT.java index 474664c..f816c7a 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/TransactionGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/TransactionGatewayIT.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.math.BigDecimal; import java.util.HashMap; @@ -29,20 +29,23 @@ import com.braintreegateway.TransactionCloneRequest; import com.braintreegateway.TransactionRefundRequest; import com.braintreegateway.TransactionRequest; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.TransactionGatewayApiMethod; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public class TransactionGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class TransactionGatewayIT extends AbstractBraintreeTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(TransactionGatewayIntegrationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(TransactionGatewayIT.class); private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(TransactionGatewayApiMethod.class).getName(); @@ -53,7 +56,7 @@ public class TransactionGatewayIntegrationTest extends AbstractBraintreeTestSupp // // ************************************************************************* - public TransactionGatewayIntegrationTest() { + public TransactionGatewayIT() { this.gateway = null; this.transactionIds = new LinkedList<>(); } diff --git a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/WebhookNotificationGatewayIntegrationTest.java b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/WebhookNotificationGatewayIT.java similarity index 96% rename from components/camel-braintree/src/test/java/org/apache/camel/component/braintree/WebhookNotificationGatewayIntegrationTest.java rename to components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/WebhookNotificationGatewayIT.java index eee4cde..4282b7d 100644 --- a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/WebhookNotificationGatewayIntegrationTest.java +++ b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/integration/WebhookNotificationGatewayIT.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.braintree; +package org.apache.camel.component.braintree.integration; import java.text.SimpleDateFormat; import java.util.HashMap; @@ -25,17 +25,21 @@ import com.braintreegateway.ConnectedMerchantPayPalStatusChanged; import com.braintreegateway.ConnectedMerchantStatusTransitioned; import com.braintreegateway.WebhookNotification; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.braintree.AbstractBraintreeTestSupport; +import org.apache.camel.component.braintree.AuthenticationType; import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.BraintreeConstants; import org.apache.camel.component.braintree.internal.WebhookNotificationGatewayApiMethod; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assumptions.assumeTrue; -public class WebhookNotificationGatewayIntegrationTest extends AbstractBraintreeTestSupport { +@EnabledIfSystemProperty(named = "braintreeAuthenticationType", matches = ".*") +public class WebhookNotificationGatewayIT extends AbstractBraintreeTestSupport { private static final String PATH_PREFIX = BraintreeApiCollection.getCollection().getApiName(WebhookNotificationGatewayApiMethod.class).getName(); diff --git a/components/camel-braintree/src/test/resources/test-options.properties b/components/camel-braintree/src/test/resources/test-options.properties index 406437d..00f792c 100644 --- a/components/camel-braintree/src/test/resources/test-options.properties +++ b/components/camel-braintree/src/test/resources/test-options.properties @@ -16,8 +16,8 @@ ## --------------------------------------------------------------------------- #environment = SANDBOX -#merchantId = -#publicKey = +#merchantId = +#publicKey = #privateKey = #accessToken =