* Basic failing - forgetting the external id or foreign key external id
*/
private void doUpsertFailBasic(boolean upsertFk) throws Exception {
// setup our dynabeans
BasicDynaClass dynaClass = setupDynaClass("Account");
Map<String, Object> sforceMapping = new HashMap<String, Object>();
sforceMapping.put("Name", "newname" + System.currentTimeMillis());
sforceMapping.put("Description", "the new description");
// Account number is set for easier test data cleanup
sforceMapping.put("AccountNumber", ACCOUNT_NUMBER_PREFIX + System.currentTimeMillis());
// Add FAILURE for upsert on FK.
String extIdField = setExtIdField(DEFAULT_ACCOUNT_EXT_ID_FIELD);
Object extIdValue = getRandomExtId("Account", ACCOUNT_WHERE_CLAUSE, null);
if (upsertFk) {
sforceMapping.put(extIdField, extIdValue);
// forget to set the foreign key external id value
sforceMapping.put(ObjectField.formatAsString("Parent", extIdField), "bogus");
}
// now convert to a dynabean array for the client
DynaBean sforceObj = dynaClass.newInstance();
// This does an automatic conversion of types.
BeanUtils.copyProperties(sforceObj, sforceMapping);
List<DynaBean> beanList = new ArrayList<DynaBean>();