@Test public void testRetrieveBadId() throws IOException { try { conn.retrieve("Contact", new Id("0035000000kmzzz"), Arrays.asList("FirstName", "LastName")); fail(); } catch (ApiException e) { assertEquals( "https: e.getUrl()); assertEquals("Not Found", e.getHttpReason()); assertJsonStringEquals( "[{\"message\":\"The requested resource does not exist\",\"errorCode\":\"NOT_FOUND\"}]", e.getHttpResponseBody()); assertEquals(404, e.getHttpResponseCode()); List<ApiError> errors = e.getErrors(); assertEquals(1, errors.size()); ApiError error = errors.get(0); assertEquals("NOT_FOUND", error.getErrorCode()); assertEquals("The requested resource does not exist", error.getMessage()); assertEquals(0, error.getFields().size()); } }
@Override @Nonnull public SObject retrieve(String sObjectType, Id id, List<String> fields) throws IOException { Timer.Context context = retrieveTimer.time(); String json; try { json = this.getHttpApiClient().retrieve(sObjectType, id, fields); } finally { context.stop(); } return getSObject(this.objectReader.readValue(parse(json), JsonNode.class)); }
RestConnectionImpl implements RestConnection { @Override @Nonnull public SObject retrieve(String sObjectType, Id id, List<String> fields) throws IOException { Timer.Context context = retrieveTimer.time(); String json; try { json = this.getHttpApiClient().retrieve(sObjectType, id, fields); } finally { context.stop(); } return getSObject(this.objectReader.readValue(parse(json), JsonNode.class)); } }
RestConnectionImpl implements RestConnection { @Override @Nonnull public SObject retrieve(String sObjectType, Id id, List<String> fields) throws IOException { Timer.Context context = retrieveTimer.time(); String json; try { json = this.getHttpApiClient().retrieve(sObjectType, id, fields); } finally { context.stop(); } return getSObject(this.objectReader.readValue(parse(json), JsonNode.class)); } RestConnectionImpl(ObjectReader objectReader, HttpApiClientProvider httpApiClientProvider,
            MetricRegistry metricRegistry); }
RestConnectionImpl implements RestConnection { @Override @Nonnull public SObject retrieve(String sObjectType, Id id, List<String> fields) throws IOException { Timer.Context context = retrieveTimer.time(); String json; try { json = this.getHttpApiClient().retrieve(sObjectType, id, fields); } finally { context.stop(); } return getSObject(this.objectReader.readValue(parse(json), JsonNode.class)); } 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 SObject retrieve(String sObjectType, Id id, List<String> fields) throws IOException { Timer.Context context = retrieveTimer.time(); String json; try { json = this.getHttpApiClient().retrieve(sObjectType, id, fields); } finally { context.stop(); } return getSObject(this.objectReader.readValue(parse(json), JsonNode.class)); } 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);  }