use of org.apache.camel.component.salesforce.api.dto.composite.SObjectBatch in project camel by apache.
the class CompositeApiBatchIntegrationTest method shouldSupportQuery.
@Test
public void shouldSupportQuery() {
final SObjectBatch batch = new SObjectBatch(version);
batch.addQuery("SELECT Id, Name FROM Account");
final SObjectBatchResponse response = testBatch(batch);
final List<SObjectBatchResult> results = response.getResults();
final SObjectBatchResult batchResult = results.get(0);
@SuppressWarnings("unchecked") final Map<String, Object> result = (Map<String, Object>) batchResult.getResult();
// JSON and XML structure are different, XML has `QueryResult` node, JSON does not
@SuppressWarnings("unchecked") final Map<String, String> data = (Map<String, String>) result.getOrDefault("QueryResult", result);
assertNotNull(data.get("totalSize"));
}
use of org.apache.camel.component.salesforce.api.dto.composite.SObjectBatch in project camel by apache.
the class CompositeApiBatchIntegrationTest method shouldSupportQueryAll.
@Test
public void shouldSupportQueryAll() {
final SObjectBatch batch = new SObjectBatch(version);
batch.addQueryAll("SELECT Id, Name FROM Account");
final SObjectBatchResponse response = testBatch(batch);
final List<SObjectBatchResult> results = response.getResults();
final SObjectBatchResult batchResult = results.get(0);
@SuppressWarnings("unchecked") final Map<String, Object> result = (Map<String, Object>) batchResult.getResult();
// JSON and XML structure are different, XML has `QueryResult` node, JSON does not
@SuppressWarnings("unchecked") final Map<String, String> data = (Map<String, String>) result.getOrDefault("QueryResult", result);
assertNotNull(data.get("totalSize"));
}
use of org.apache.camel.component.salesforce.api.dto.composite.SObjectBatch in project camel by apache.
the class CompositeApiBatchIntegrationTest method shouldSupportObjectRetrieval.
@Test
public void shouldSupportObjectRetrieval() {
final SObjectBatch batch = new SObjectBatch(version);
batch.addGet("Account", accountId, "Name");
final SObjectBatchResponse response = testBatch(batch);
final List<SObjectBatchResult> results = response.getResults();
final SObjectBatchResult batchResult = results.get(0);
@SuppressWarnings("unchecked") final Map<String, Object> result = (Map<String, Object>) batchResult.getResult();
// JSON and XML structure are different, XML has `Account` node, JSON does not
@SuppressWarnings("unchecked") final Map<String, String> data = (Map<String, String>) result.getOrDefault("Account", result);
assertEquals("Composite API Batch", data.get("Name"));
}
use of org.apache.camel.component.salesforce.api.dto.composite.SObjectBatch in project camel by apache.
the class CompositeApiBatchIntegrationTest method shouldSupportObjectDeletion.
@Test
public void shouldSupportObjectDeletion() {
final SObjectBatch batch = new SObjectBatch(version);
batch.addDelete("Account", accountId);
testBatch(batch);
}
Aggregations