Skip to content

Commit

Permalink
Merge pull request #28 from kesavany/master
Browse files Browse the repository at this point in the history
Fix to support EI 6.5.0.
  • Loading branch information
keerthu authored May 3, 2019
2 parents aa97776 + 6c4c434 commit 34210a6
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Salesforce REST EI Connector

The Salesforce REST [Connector](https://docs.wso2.com/display/EI640/Working+with+Connectors) allows you to work with records in Salesforce, a web-based service that allows organizations to manage contact relationship management (CRM) data. You can use the Salesforce connector to create, query, retrieve, update, and delete records in your organization's Salesforce data. The connector uses the [Salesforce REST API](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm) to interact with Salesforce.
The Salesforce REST [Connector](https://docs.wso2.com/display/EI650/Working+with+Connectors) allows you to work with records in Salesforce, a web-based service that allows organizations to manage contact relationship management (CRM) data. You can use the Salesforce connector to create, query, retrieve, update, and delete records in your organization's Salesforce data. The connector uses the [Salesforce REST API](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm) to interact with Salesforce.

## Compatibility

| Connector version | Supported Salesforce REST API version | Supported WSO2 ESB/EI version |
| ------------- | ------------- | ------------- |
| [1.0.7](https://github.com/wso2-extensions/esb-connector-salesforcerest/tree/org.wso2.carbon.connector.salesforcerest-1.0.7) | v32.0 | EI 6.5.0 |
| [1.0.6](https://github.com/wso2-extensions/esb-connector-salesforcerest/tree/org.wso2.carbon.connector.salesforcerest-1.0.6) | v32.0 | ESB 5.0.0, EI 6.1.0, 6.1.1, 6.2.0, 6.3.0, 6.4.0 |
| [1.0.5](https://github.com/wso2-extensions/esb-connector-salesforcerest/tree/org.wso2.carbon.connector.salesforcerest-1.0.5) | v32.0 | ESB 5.0.0, EI 6.1.0, 6.1.1, 6.2.0, 6.3.0, 6.4.0 |
| [1.0.4](https://github.com/wso2-extensions/esb-connector-salesforcerest/tree/org.wso2.carbon.connector.salesforcerest-1.0.4) | v32.0 | ESB 4.9.0, 5.0.0 |
Expand All @@ -15,9 +16,9 @@ The Salesforce REST [Connector](https://docs.wso2.com/display/EI640/Working+with
#### Download and install the connector

1. Download the connector from the [WSO2 Store](https://store.wso2.com/store/assets/esbconnector/details/43e44763-0d73-4ab3-8ae9-d6f73532d164) by clicking the Download Connector button.
2. Then you can follow this [Documentation](https://docs.wso2.com/display/EI640/Working+with+Connectors+via+the+Management+Console) to add and enable the connector via the Management Console in your EI instance.
3. For more information on using connectors and their operations in your EI configurations, see [Using a Connector](https://docs.wso2.com/display/EI640/Using+a+Connector).
4. If you want to work with connectors via EI tooling, see [Working with Connectors via Tooling](https://docs.wso2.com/display/EI640/Working+with+Connectors+via+Tooling).
2. Then you can follow this [Documentation](https://docs.wso2.com/display/EI650/Working+with+Connectors+via+the+Management+Console) to add and enable the connector via the Management Console in your EI instance.
3. For more information on using connectors and their operations in your EI configurations, see [Using a Connector](https://docs.wso2.com/display/EI650/Using+a+Connector).
4. If you want to work with connectors via EI tooling, see [Working with Connectors via Tooling](https://docs.wso2.com/display/EI650/Working+with+Connectors+via+Tooling).

#### Configuring the connector operations

Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
<groupId>org.wso2.carbon.connector</groupId>
<artifactId>org.wso2.carbon.connector.salesforcerest</artifactId>
<packaging>jar</packaging>
<version>1.0.7-SNAPSHOT</version>
<version>1.0.7</version>
<name>WSO2 Carbon - Mediation Library Connector For Salesforcerest</name>
<url>http://wso2.org</url>
<properties>
<connector.name>salesforcerest</connector.name>
<product.ei.version>6.4.0</product.ei.version>
<product.ei.version>6.5.0</product.ei.version>
<carbon.kernel.version>4.4.17</carbon.kernel.version>
<automation.framework.utils.version>4.4.2</automation.framework.utils.version>
<automation.framework.version>4.4.3</automation.framework.version>
<emma.version>2.1.5320</emma.version>
<synapse.version>2.1.7-wso2v19</synapse.version>
<carbon.mediation.version>4.6.19</carbon.mediation.version>
<json.version>2.0.0.wso2v1</json.version>
<synapse.version>2.1.7-wso2v95</synapse.version>
<carbon.mediation.version>4.6.123</carbon.mediation.version>
<json.version>3.0.0.wso2v1</json.version>
<org.testng.version>6.1.1</org.testng.version>
<jets3t.version>0.9.4</jets3t.version>
<bouncycastle.version>1.55</bouncycastle.version>
Expand Down Expand Up @@ -169,9 +169,9 @@
<version>${product.ei.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.ei</groupId>
<groupId>org.wso2.carbon.mediation</groupId>
<artifactId>org.wso2.carbon.integrator.core</artifactId>
<version>${product.ei.version}</version>
<version>${carbon.mediation.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.ei</groupId>
Expand Down
2 changes: 1 addition & 1 deletion repository/esb-connector-salesforcerest.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ apiUrl=https://kesavan-dev-ed.my.salesforce.com
apiVersion=v32.0
refreshToken=5Aep861TSESvWeug_wh8Zdrl_VI2_3Nto6FnQjpVsd1el5_cxt1qKRiVmI5B5x6ABH.QEq4FGbXtI5ARrLxzibR
clientSecret=9148186152266986099
clientId=3MVG9ZL0ppGP5UrBKpO5NfGJn9gXRXLOKwHHYHfEh.gTMriEXwhf6DFvyPl481H09MQ8EUAwQxmFraW3k0KgU
clientId=3MVG9ZL0ppGP5UrBKpO5NfGJn9gXRXLOKwHHYHfEh.gTMriEXwhf6DFvyPl481H09MQ8EUAwQxmFraW3k0KgU
8 changes: 4 additions & 4 deletions src/test/INTEGRATION-TEST.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
## Integration tests for WSO2 ESB Salesforce REST connector
## Integration tests for WSO2 EI Salesforce REST connector
### Pre-requisites:

- Maven 3.x
- Java 1.8

### Tested Platforms:

- Mac OS 10.12.6
- WSO2 EI 6.4.0
- Ubuntu 16.04
- WSO2 EI 6.5.0


Steps to follow in setting integration test.


1. Download EI 6.4.0 from official website.
1. Download EI 6.5.0 from official website.

2. Create a Salesforce account and create a connected app.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void describeGlobal() throws IOException, JSONException {
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("sobjects"), apiRestResponse.getBody().getString("sobjects"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("sobjects").length(), apiRestResponse.getBody().getJSONArray("sobjects").length());
}

/**
Expand Down Expand Up @@ -130,7 +130,7 @@ public void sObjectBasicInfo() throws IOException, JSONException {
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("objectDescribe"), apiRestResponse.getBody().getString("objectDescribe"));
Assert.assertEquals(esbRestResponse.getBody().getJSONObject("objectDescribe").toString(), apiRestResponse.getBody().getJSONObject("objectDescribe").toString());
}

/**
Expand Down Expand Up @@ -189,7 +189,7 @@ public void query() throws IOException, JSONException {
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("records"), apiRestResponse.getBody().getString("records"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("records").toString(), apiRestResponse.getBody().getJSONArray("records").toString());
}

/**
Expand All @@ -204,7 +204,7 @@ public void queryPerformanceFeedback() throws IOException, JSONException {
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("plans"), apiRestResponse.getBody().getString("plans"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("plans").length(), apiRestResponse.getBody().getJSONArray("plans").length());
}

/**
Expand All @@ -219,7 +219,7 @@ public void queryAll() throws IOException, JSONException {
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("records"), apiRestResponse.getBody().getString("records"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("records").toString(), apiRestResponse.getBody().getJSONArray("records").toString());
}

/**
Expand Down Expand Up @@ -262,7 +262,7 @@ public void getSpecificAction() throws IOException, JSONException {
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("layout"), apiRestResponse.getBody().getString("layout"));
Assert.assertEquals(esbRestResponse.getBody().toString(), apiRestResponse.getBody().toString());
}

/**
Expand Down Expand Up @@ -403,7 +403,7 @@ public void listViews() throws IOException, JSONException {
connectorProperties.put("listViewID",listViewId);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("listviews"), apiRestResponse.getBody().getString("listviews"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("listviews").length(), apiRestResponse.getBody().getJSONArray("listviews").length());
}

/**
Expand Down Expand Up @@ -447,7 +447,7 @@ public void listviewQueryPerformanceFeedback() throws IOException, JSONException
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("plans"), apiRestResponse.getBody().getString("plans"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("plans").toString(), apiRestResponse.getBody().getJSONArray("plans").toString());
}

/**
Expand All @@ -461,7 +461,7 @@ public void listViewResultsWithMandatoryParameters() throws IOException, JSONExc
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("columns"), apiRestResponse.getBody().getString("columns"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("columns").toString(), apiRestResponse.getBody().getJSONArray("columns").toString());
}

/**
Expand All @@ -476,7 +476,7 @@ public void recentListViews() throws IOException, JSONException {
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("listviews"), apiRestResponse.getBody().getString("listviews"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("listviews").toString(), apiRestResponse.getBody().getJSONArray("listviews").toString());
}

/**
Expand All @@ -491,7 +491,7 @@ public void listApprovals() throws IOException, JSONException {
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("approvals"), apiRestResponse.getBody().getString("approvals"));
Assert.assertEquals(esbRestResponse.getBody().getJSONObject("approvals").toString(), apiRestResponse.getBody().getJSONObject("approvals").toString());
}

/**
Expand Down Expand Up @@ -672,7 +672,7 @@ public void sObjectLayoutsWithMandatoryParameters() throws IOException, JSONExce
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).getString("buttonLayoutSection"), apiRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).getString("buttonLayoutSection"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).toString(), apiRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).toString());
}

/**
Expand All @@ -686,7 +686,7 @@ public void globalSObjectLayoutsWithMandatoryParameters() throws IOException, JS
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).getString("buttonLayoutSection"), apiRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).getString("buttonLayoutSection"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).toString(), apiRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).toString());
}

/**
Expand All @@ -700,7 +700,7 @@ public void compactLayoutsWithMandatoryParameters() throws IOException, JSONExce
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("Account"), apiRestResponse.getBody().getString("Account"));
Assert.assertEquals(esbRestResponse.getBody().getJSONObject("Account").toString(), apiRestResponse.getBody().getJSONObject("Account").toString());
}

/**
Expand All @@ -727,7 +727,7 @@ public void sObjectCompactLayoutsWithMandatoryParameters() throws IOException, J
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("compactLayouts").getJSONObject(0).getString("actions"), apiRestResponse.getBody().getJSONArray("compactLayouts").getJSONObject(0).getString("actions"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("compactLayouts").getJSONObject(0).toString(), apiRestResponse.getBody().getJSONArray("compactLayouts").getJSONObject(0).toString());
}

/**
Expand All @@ -741,7 +741,7 @@ public void sObjectNamedLayoutsWithMandatoryParameters() throws IOException, JSO
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).getString("buttonLayoutSection"), apiRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).getString("buttonLayoutSection"));
Assert.assertEquals(esbRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).toString(), apiRestResponse.getBody().getJSONArray("layouts").getJSONObject(0).toString());
}

/**
Expand Down Expand Up @@ -769,7 +769,7 @@ public void listOrganizationLimitsWithMandatoryParameters() throws IOException,
RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, "GET", apiRequestHeadersMap);
Assert.assertEquals(esbRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(apiRestResponse.getHttpStatusCode(), 200);
Assert.assertEquals(esbRestResponse.getBody().getString("ConcurrentAsyncGetReportInstances"), apiRestResponse.getBody().getString("ConcurrentAsyncGetReportInstances"));
Assert.assertEquals(esbRestResponse.getBody().getJSONObject("ConcurrentAsyncGetReportInstances").toString(), apiRestResponse.getBody().getJSONObject("ConcurrentAsyncGetReportInstances").toString());
}

/**
Expand Down

0 comments on commit 34210a6

Please sign in to comment.