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");
}