Package org.apache.camel.component.salesforce.api.dto

Examples of org.apache.camel.component.salesforce.api.dto.CreateSObjectResult


            }
            if (callback.getException() != null) {
                throw callback.getException();
            }

            CreateSObjectResult result = OBJECT_MAPPER.readValue(callback.getResponse(), CreateSObjectResult.class);
            if (!result.getSuccess()) {
                final SalesforceException salesforceException = new SalesforceException(
                        result.getErrors(), HttpStatus.BAD_REQUEST_400);
                throw new CamelException(
                        String.format("Error creating Topic %s: %s", topicName, result.getErrors()),
                        salesforceException);
            }
        } catch (SalesforceException e) {
            throw new CamelException(
                    String.format("Error creating Topic %s: %s", topicName, e.getMessage()),
View Full Code Here


        Merchandise__c merchandise = new Merchandise__c();
        merchandise.setName("Wee Wee Wee Plane");
        merchandise.setDescription__c("Microlite plane");
        merchandise.setPrice__c(2000.0);
        merchandise.setTotal_Inventory__c(50.0);
        CreateSObjectResult result = template().requestBody("direct:CreateSObject" + suffix,
            merchandise, CreateSObjectResult.class);
        assertNotNull(result);
        assertTrue("Create success", result.getSuccess());
        LOG.debug("Create: " + result);

        // test JSON update
        // make the plane cheaper
        merchandise.setPrice__c(1500.0);
        // change inventory to half
        merchandise.setTotal_Inventory__c(25.0);
        // also need to set the Id
        merchandise.setId(result.getId());

        assertNull(template().requestBodyAndHeader("direct:UpdateSObject" + suffix,
            merchandise, SalesforceEndpointConfig.SOBJECT_ID, result.getId()));
        LOG.debug("Update successful");

        // delete the newly created SObject
        assertNull(template().requestBody("direct:deleteSObject" + suffix, result.getId()));
        LOG.debug("Delete successful");
    }
View Full Code Here

        lineItem.setUnit_Price__c(1000.0);
        lineItem.setUnits_Sold__c(50.0);
        // update line item with Name NEW_LINE_ITEM_ID
        lineItem.setName(NEW_LINE_ITEM_ID);

        CreateSObjectResult result = template().requestBodyAndHeader("direct:upsertSObject" + suffix,
            lineItem, SalesforceEndpointConfig.SOBJECT_EXT_ID_VALUE, NEW_LINE_ITEM_ID,
            CreateSObjectResult.class);
        assertNotNull(result);
        assertTrue(result.getSuccess());
        LOG.debug("CreateWithId: {}", result);

        // clear read only parent type fields
        lineItem.setInvoice_Statement__c(null);
        lineItem.setMerchandise__c(null);
View Full Code Here

        Merchandise__c merchandise = new Merchandise__c();
        merchandise.setName("TestNotification");
        merchandise.setDescription__c("Merchandise for testing Streaming API updated on " + new DateTime().toString());
        merchandise.setPrice__c(9.99);
        merchandise.setTotal_Inventory__c(1000.0);
        CreateSObjectResult result = template().requestBody(
            "direct:upsertSObject", merchandise, CreateSObjectResult.class);
        assertTrue("Merchandise test record not created",  result == null || result.getSuccess());

        try {
            // wait for Salesforce notification
            mock.assertIsSatisfied();
            final Message in = mock.getExchanges().get(0).getIn();
View Full Code Here

TOP

Related Classes of org.apache.camel.component.salesforce.api.dto.CreateSObjectResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.