@Test public void testDeleteBadId() throws ApiException { List<Id> idList = new ArrayList<Id>(); Id id = new Id("00Q7zzz000Kj4Jn"); idList.add(id); List<DeleteResult> results = this.conn.delete(idList); assertEquals(1, results.size()); DeleteResult res = results.get(0); assertFalse(res.isSuccess()); assertNull(res.getId()); assertEquals(1, res.getErrors().size()); PartnerApiError error = res.getErrors().get(0); assertEquals(StatusCodeType.MALFORMED___ID, error.getStatusCode()); assertEquals("bad id " + id.toString(), error.getMessage()); assertEquals(0, error.getFields().size()); }
@Nonnull @Override public synchronized List<DeleteResult> delete(@Nonnull List<Id> ids) throws ApiException { logger.entry(ids); Delete deleteParam = new Delete(); for (Id id : ids) { deleteParam.getIds().add(id.toString()); } DeleteResponse response; DeleteOp op = this.new DeleteOp(); response = op.execute(deleteParam); List<DeleteResult> results = new ArrayList<DeleteResult>(); for (DeleteResultType stubResult : response.getResult()) { results.add(new DeleteResult(stubResult)); } logger.exit(results); return results; }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<DeleteResult> delete(@Nonnull List<Id> ids) throws ApiException { logger.entry(ids); Delete deleteParam = new Delete(); for (Id id : ids) { deleteParam.getIds().add(id.toString()); } DeleteResponse response; DeleteOp op = this.new DeleteOp(); response = op.execute(deleteParam); List<DeleteResult> results = new ArrayList<DeleteResult>(); for (DeleteResultType stubResult : response.getResult()) { results.add(new DeleteResult(stubResult)); } logger.exit(results); return results; } }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<DeleteResult> delete(@Nonnull List<Id> ids) throws ApiException { logger.entry(ids); Delete deleteParam = new Delete(); for (Id id : ids) { deleteParam.getIds().add(id.toString()); } DeleteResponse response; DeleteOp op = this.new DeleteOp(); response = op.execute(deleteParam); List<DeleteResult> results = new ArrayList<DeleteResult>(); for (DeleteResultType stubResult : response.getResult()) { results.add(new DeleteResult(stubResult)); } logger.exit(results); return results; } private  PartnerConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<DeleteResult> delete(@Nonnull List<Id> ids) throws ApiException { logger.entry(ids); Delete deleteParam = new Delete(); for (Id id : ids) { deleteParam.getIds().add(id.toString()); } DeleteResponse response; DeleteOp op = this.new DeleteOp(); response = op.execute(deleteParam); List<DeleteResult> results = new ArrayList<DeleteResult>(); for (DeleteResultType stubResult : response.getResult()) { results.add(new DeleteResult(stubResult)); } logger.exit(results); return results; } private  PartnerConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); @Override synchronized int count(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int count(@Nonnull String sObjectType); @Override synchronized int countAll(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int countAll(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SaveResult> create(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<DeleteResult> delete(@Nonnull List<Id> ids); @Nonnull @Override synchronized DescribeGlobalResult describeGlobal(); @Nonnull @Override synchronized SObjectDescription describeSObject(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SObjectDescription> describeSObjects(@Nonnull List<String> sObjectTypes); @Nonnull @Override synchronized List<EmptyRecycleBinResult> emptyRecycleBin(@Nonnull List<Id> ids); @Nonnull @Override synchronized DateTime getServerTimestamp(); @Nonnull @Override synchronized UserInfo getUserInfo(); @Nonnull @Override synchronized PartnerQueryResult query(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryAll(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryMore(@Nonnull PartnerQueryLocator locator); @Nonnull @Override synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fieldList); @Nonnull @Override synchronized Map<Id, SObject> retrieveExtended(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fields,
            int maxFieldNameChunkSize); @Nonnull @Override synchronized List<UndeleteResult> undelete(@Nonnull List<Id> ids); @Nonnull @Override synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<UpsertResult> upsert(@Nonnull String externalIdFieldName, @Nonnull List<SObject> sObjects); }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<DeleteResult> delete(@Nonnull List<Id> ids) throws ApiException { logger.entry(ids); Delete deleteParam = new Delete(); for (Id id : ids) { deleteParam.getIds().add(id.toString()); } DeleteResponse response; DeleteOp op = this.new DeleteOp(); response = op.execute(deleteParam); List<DeleteResult> results = new ArrayList<DeleteResult>(); for (DeleteResultType stubResult : response.getResult()) { results.add(new DeleteResult(stubResult)); } logger.exit(results); return results; } private  PartnerConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); @Override synchronized int count(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int count(@Nonnull String sObjectType); @Override synchronized int countAll(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int countAll(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SaveResult> create(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<DeleteResult> delete(@Nonnull List<Id> ids); @Nonnull @Override synchronized DescribeGlobalResult describeGlobal(); @Nonnull @Override synchronized SObjectDescription describeSObject(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SObjectDescription> describeSObjects(@Nonnull List<String> sObjectTypes); @Nonnull @Override synchronized List<EmptyRecycleBinResult> emptyRecycleBin(@Nonnull List<Id> ids); @Nonnull @Override synchronized DateTime getServerTimestamp(); @Nonnull @Override synchronized UserInfo getUserInfo(); @Nonnull @Override synchronized PartnerQueryResult query(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryAll(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryMore(@Nonnull PartnerQueryLocator locator); @Nonnull @Override synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fieldList); @Nonnull @Override synchronized Map<Id, SObject> retrieveExtended(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fields,
            int maxFieldNameChunkSize); @Nonnull @Override synchronized List<UndeleteResult> undelete(@Nonnull List<Id> ids); @Nonnull @Override synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<UpsertResult> upsert(@Nonnull String externalIdFieldName, @Nonnull List<SObject> sObjects);  }