use of org.apache.camel.component.salesforce.dto.generated.Account in project camel by apache.
the class SObjectTreeTest method shouldSetIdByReferencesForNestedObjects.
@Test
public void shouldSetIdByReferencesForNestedObjects() {
final SObjectTree tree = new SObjectTree();
final Account account = new Account();
final SObjectNode accountNode = new SObjectNode(tree, account);
tree.addNode(accountNode);
final Contact contact = new Contact();
final SObjectNode contactNode = new SObjectNode(tree, contact);
accountNode.addChild("Contacts", contactNode);
final Asset asset = new Asset();
final SObjectNode assetNode = new SObjectNode(tree, asset);
contactNode.addChild("Assets", assetNode);
assertEquals("ref1", accountNode.getAttributes().getReferenceId());
assertEquals("ref2", contactNode.getAttributes().getReferenceId());
assertEquals("ref3", assetNode.getAttributes().getReferenceId());
tree.setIdFor("ref1", "id1");
tree.setIdFor("ref3", "id3");
tree.setIdFor("ref2", "id2");
assertEquals("id1", account.getId());
assertEquals("id2", contact.getId());
assertEquals("id3", asset.getId());
}
use of org.apache.camel.component.salesforce.dto.generated.Account in project camel by apache.
the class SObjectTreeTest method treeWithOneNodeShouldHaveSizeOfOne.
@Test
public void treeWithOneNodeShouldHaveSizeOfOne() {
final SObjectTree tree = new SObjectTree();
tree.addObject(new Account());
assertEquals(1, tree.size());
}
use of org.apache.camel.component.salesforce.dto.generated.Account in project camel by apache.
the class SObjectTreeTest method treeWithTwoNodesShouldHaveSizeOfTwo.
@Test
public void treeWithTwoNodesShouldHaveSizeOfTwo() {
final SObjectTree tree = new SObjectTree();
tree.addObject(new Account());
tree.addObject(new Account());
assertEquals(2, tree.size());
}
use of org.apache.camel.component.salesforce.dto.generated.Account in project camel by apache.
the class SObjectTreeTest method shouldCollectAllObjectTypesInTheTree.
@Test
public void shouldCollectAllObjectTypesInTheTree() {
final SObjectTree tree = new SObjectTree();
tree.addObject(new Account()).addChild(new Contact()).addChild("Assets", new Asset());
tree.addObject(new Account());
final Class[] types = tree.objectTypes();
Arrays.sort(types, (final Class l, final Class r) -> l.getName().compareTo(r.getName()));
assertArrayEquals(new Class[] { Account.class, Asset.class, Contact.class }, types);
}
use of org.apache.camel.component.salesforce.dto.generated.Account in project camel by apache.
the class CompositeApiBatchIntegrationTest method shouldSupportObjectUpdates.
@Test
public void shouldSupportObjectUpdates() {
final SObjectBatch batch = new SObjectBatch(version);
final Account updates = new Account();
updates.setName("NewName");
updates.setAccountNumber("AC12345");
batch.addUpdate("Account", accountId, updates);
testBatch(batch);
}
Aggregations