This is an automated email from the ASF dual-hosted git repository. aldettinger 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 fcc421c CAMEL-13746: Fixed issues in camel-salesforce integration tests fcc421c is described below commit fcc421c42beec103d91ff5129794c083af1d2da3 Author: aldettinger <aldettin...@gmail.com> AuthorDate: Thu Jul 11 15:50:20 2019 +0200 CAMEL-13746: Fixed issues in camel-salesforce integration tests --- components/camel-salesforce/camel-salesforce-component/README.md | 5 +++-- components/camel-salesforce/camel-salesforce-component/pom.xml | 9 +++++++++ .../salesforce/internal/client/DefaultBulkApiClient.java | 1 + .../salesforce/ChangeEventsConsumerIntegrationTest.java | 2 ++ .../salesforce/PlatformEventsConsumerIntegrationTest.java | 2 ++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/components/camel-salesforce/camel-salesforce-component/README.md b/components/camel-salesforce/camel-salesforce-component/README.md index b877b34..f1bb76c 100644 --- a/components/camel-salesforce/camel-salesforce-component/README.md +++ b/components/camel-salesforce/camel-salesforce-component/README.md @@ -100,12 +100,12 @@ If your tests cannot be run alongside other tests you can use `@Category(Standal #### Manual Salesforce instance setup for integration tests -This is include for those that wish to setup the Salesforce instance manually for integration tests. It could also help to double-check your setup. +This is included for those that wish to setup the Salesforce instance manually for integration tests. It could also help to double-check your setup. Besides that account you'll need a _test user_ account that has `Bulk API Hard Delete` permission. You can create one by going to _My Developer Account_ (link from [developer.salesforce.com](https://login.salesforce.com/?lt=de)). Under _Administer_ expand _Manage Users_ and select _Profiles_ find _System Administrator_ profile and select _Clone_. Use `System Administrator With Hard Delete` as the profile name, and after saving under _Administrative Permissions_ click edit and tick _Bulk [...] Install the Warehouse package, tested with _Spring 2013_ (version 1.2) that can be installed from the [https://login.salesforce.com/packaging/installPackage.apexp?p0=04ti0000000Pj8s](https://login.salesforce.com/packaging/installPackage.apexp?p0=04ti0000000Pj8s), and make the following modifications manually: - - add custom field `Description` of type `Text` with maxumum length of `100` on the `Merchandise` object + - add custom field `Description` of type `Text` with maximum length of `100` on the `Merchandise` object - add custom **required** field `Total_Inventory` of type `Number` with maximum length of `18` without default value on the `Merchandise` object - add custom field `Shipping_Location` of type `GeoLocation` on the `Account` object - add custom field `Units_Sold` of `Number` type with maximum length of `18` on the `Line_Item` object @@ -114,6 +114,7 @@ Install the Warehouse package, tested with _Spring 2013_ (version 1.2) that can - create new ApexClass named `MerchandiseRestResource` with the content of `MerchandiseRestResource.apxc` - deactivate the `Contact Duplicate Rule` in salesforce configuration - add `Account` to selected entities for change data capture in the _Integrations/Change Data Capture_ menu + - add the `Hard Delete Permission Set` to the CamelSalesforceIntegrationTests Connected App (e.g. Setup/ConnectedApp/ManagePermissionSets) You'll need to access a Merchandise record and run a `Test Report` in order for them to appear in _Recent Items_ and _Recent Reports_. Do this by accessing _Warehouse_ application from the menu in the top right, and selecting _Merchandise_ click _Go!_ (preselected is View: _All_) and click on the single Merchandise item available. Next go to Reports and select and run _Test Report_ from _Test Reports_. This is needed by the integration tests as they access recent items and recently run reports. diff --git a/components/camel-salesforce/camel-salesforce-component/pom.xml b/components/camel-salesforce/camel-salesforce-component/pom.xml index c031dee..395e13a 100644 --- a/components/camel-salesforce/camel-salesforce-component/pom.xml +++ b/components/camel-salesforce/camel-salesforce-component/pom.xml @@ -218,6 +218,15 @@ <build> <plugins> <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>**/*IntegrationTest.java</exclude> + </excludes> + </configuration> + </plugin> + <plugin> <groupId>org.codehaus.gmavenplus</groupId> <artifactId>gmavenplus-plugin</artifactId> <version>${gmavenplus-plugin-version}</version> diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultBulkApiClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultBulkApiClient.java index be417ef..160118f 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultBulkApiClient.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultBulkApiClient.java @@ -428,6 +428,7 @@ public class DefaultBulkApiClient extends AbstractClientBase implements BulkApiC // Disable XXE SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); try { spf.setFeature(javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); spf.setFeature("http://xml.org/sax/features/external-general-entities", false); diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ChangeEventsConsumerIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ChangeEventsConsumerIntegrationTest.java index 268a0108..17d1d1f 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ChangeEventsConsumerIntegrationTest.java +++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ChangeEventsConsumerIntegrationTest.java @@ -29,12 +29,14 @@ import org.assertj.core.api.Assertions; import org.awaitility.Awaitility; import org.junit.Assert; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * During integration tests setup, Salesforce has been configured to fire change * events for Account objects. This test merely uses some API calls to trigger * some change events, and then perform assertion on the received events. */ +@Category(Standalone.class) public class ChangeEventsConsumerIntegrationTest extends AbstractSalesforceTestBase { private static final String ACCOUNT_NAME = "ChangeEventsConsumerIntegrationTest-TestAccount"; diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/PlatformEventsConsumerIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/PlatformEventsConsumerIntegrationTest.java index 9e13dc5..20643e6 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/PlatformEventsConsumerIntegrationTest.java +++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/PlatformEventsConsumerIntegrationTest.java @@ -27,9 +27,11 @@ import org.apache.camel.component.salesforce.api.dto.PlatformEvent; import org.assertj.core.api.Assertions; import org.awaitility.Awaitility; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.assertj.core.api.Assertions.entry; +@Category(Standalone.class) public class PlatformEventsConsumerIntegrationTest extends AbstractSalesforceTestBase { @Test