@Test public void testCreateWithNoFields() throws IOException { SObject sObj = PartnerSObjectImpl.getNew("Contact"); try { conn.create(sObj); fail(); } catch (ApiException e) { assertEquals("https: e.getUrl()); assertEquals("Bad Request", e.getHttpReason()); assertJsonStringEquals( "[{\"fields\":[\"LastName\"],\"message\":\"Required fields are missing: " + "[LastName]\",\"errorCode\":\"REQUIRED_FIELD_MISSING\"}]", e.getHttpResponseBody()); assertEquals(400, e.getHttpResponseCode()); List<ApiError> errors = e.getErrors(); assertEquals(1, errors.size()); ApiError error = errors.get(0); assertEquals("REQUIRED_FIELD_MISSING", error.getErrorCode()); assertEquals("Required fields are missing: [LastName]", error.getMessage()); assertEquals(1, error.getFields().size()); assertEquals("LastName", error.getFields().get(0)); } }
@Override @Nonnull public SaveResult create(SObject sObject) throws IOException { Timer.Context context = createTimer.time(); try { return getSaveResult(this.getHttpApiClient().create(sObject)); } finally { context.stop(); } }
RestConnectionImpl implements RestConnection { @Override @Nonnull public SaveResult create(SObject sObject) throws IOException { Timer.Context context = createTimer.time(); try { return getSaveResult(this.getHttpApiClient().create(sObject)); } finally { context.stop(); } } }
RestConnectionImpl implements RestConnection { @Override @Nonnull public SaveResult create(SObject sObject) throws IOException { Timer.Context context = createTimer.time(); try { return getSaveResult(this.getHttpApiClient().create(sObject)); } finally { context.stop(); } } RestConnectionImpl(ObjectReader objectReader, HttpApiClientProvider httpApiClientProvider,
            MetricRegistry metricRegistry); }
RestConnectionImpl implements RestConnection { @Override @Nonnull public SaveResult create(SObject sObject) throws IOException { Timer.Context context = createTimer.time(); try { return getSaveResult(this.getHttpApiClient().create(sObject)); } finally { context.stop(); } } RestConnectionImpl(ObjectReader objectReader, HttpApiClientProvider httpApiClientProvider,
            MetricRegistry metricRegistry); @Override @Nonnull SaveResult create(SObject sObject); @Override void delete(String sObjectType, Id id); @Override @Nonnull DescribeGlobalResult describeGlobal(); @Override @Nonnull SObjectDescription describeSObject(String sObjectType); @Override @Nonnull BasicSObjectMetadataResult getBasicObjectInfo(String sObjectType); @Override @Nonnull RestQueryResult query(String soql); @Override @Nonnull RestQueryResult queryMore(RestQueryLocator queryLocator); @Override @Nonnull SObject retrieve(String sObjectType, Id id, List<String> fields); @Override @Nonnull List<SObject> search(String sosl); @Override void update(SObject sObject); @Override @Nonnull UpsertResult upsert(SObject sObject, String externalIdField); }
RestConnectionImpl implements RestConnection { @Override @Nonnull public SaveResult create(SObject sObject) throws IOException { Timer.Context context = createTimer.time(); try { return getSaveResult(this.getHttpApiClient().create(sObject)); } finally { context.stop(); } } RestConnectionImpl(ObjectReader objectReader, HttpApiClientProvider httpApiClientProvider,
            MetricRegistry metricRegistry); @Override @Nonnull SaveResult create(SObject sObject); @Override void delete(String sObjectType, Id id); @Override @Nonnull DescribeGlobalResult describeGlobal(); @Override @Nonnull SObjectDescription describeSObject(String sObjectType); @Override @Nonnull BasicSObjectMetadataResult getBasicObjectInfo(String sObjectType); @Override @Nonnull RestQueryResult query(String soql); @Override @Nonnull RestQueryResult queryMore(RestQueryLocator queryLocator); @Override @Nonnull SObject retrieve(String sObjectType, Id id, List<String> fields); @Override @Nonnull List<SObject> search(String sosl); @Override void update(SObject sObject); @Override @Nonnull UpsertResult upsert(SObject sObject, String externalIdField);  }