@Test public void testBasicSObjectMetadata() throws IOException { BasicSObjectMetadataResult actual = conn.getBasicObjectInfo("Account"); assertEquals(readResource("/apiResponses/basicSObjectMetadata.xml"), TestFixtureUtils.dumpFixture(actual)); }
@Override @Nonnull public BasicSObjectMetadataResult getBasicObjectInfo(String sObjectType) throws IOException { Timer.Context context = basicSObjectInfoTimer.time(); String jsonStr; try { jsonStr = this.getHttpApiClient().basicSObjectInfo(sObjectType); } finally { context.stop(); } ObjectNode objectNode = this.objectReader.withType(ObjectNode.class).readValue(jsonStr); BasicSObjectMetadata metadata = this.objectReader.withType(BasicSObjectMetadata.class).readValue(objectNode.get("objectDescribe")); ArrayNode recentItems = this.objectReader.withType(ArrayNode.class).readValue(objectNode.get("recentItems")); List<SObject> sObjects = getSObjects(recentItems.elements()); return new BasicSObjectMetadataResult(metadata, sObjects); }
RestConnectionImpl implements RestConnection { @Override @Nonnull public BasicSObjectMetadataResult getBasicObjectInfo(String sObjectType) throws IOException { Timer.Context context = basicSObjectInfoTimer.time(); String jsonStr; try { jsonStr = this.getHttpApiClient().basicSObjectInfo(sObjectType); } finally { context.stop(); } ObjectNode objectNode = this.objectReader.withType(ObjectNode.class).readValue(jsonStr); BasicSObjectMetadata metadata = this.objectReader.withType(BasicSObjectMetadata.class).readValue(objectNode.get("objectDescribe")); ArrayNode recentItems = this.objectReader.withType(ArrayNode.class).readValue(objectNode.get("recentItems")); List<SObject> sObjects = getSObjects(recentItems.elements()); return new BasicSObjectMetadataResult(metadata, sObjects); } }
RestConnectionImpl implements RestConnection { @Override @Nonnull public BasicSObjectMetadataResult getBasicObjectInfo(String sObjectType) throws IOException { Timer.Context context = basicSObjectInfoTimer.time(); String jsonStr; try { jsonStr = this.getHttpApiClient().basicSObjectInfo(sObjectType); } finally { context.stop(); } ObjectNode objectNode = this.objectReader.withType(ObjectNode.class).readValue(jsonStr); BasicSObjectMetadata metadata = this.objectReader.withType(BasicSObjectMetadata.class).readValue(objectNode.get("objectDescribe")); ArrayNode recentItems = this.objectReader.withType(ArrayNode.class).readValue(objectNode.get("recentItems")); List<SObject> sObjects = getSObjects(recentItems.elements()); return new BasicSObjectMetadataResult(metadata, sObjects); } RestConnectionImpl(ObjectReader objectReader, HttpApiClientProvider httpApiClientProvider,
            MetricRegistry metricRegistry); }
RestConnectionImpl implements RestConnection { @Override @Nonnull public BasicSObjectMetadataResult getBasicObjectInfo(String sObjectType) throws IOException { Timer.Context context = basicSObjectInfoTimer.time(); String jsonStr; try { jsonStr = this.getHttpApiClient().basicSObjectInfo(sObjectType); } finally { context.stop(); } ObjectNode objectNode = this.objectReader.withType(ObjectNode.class).readValue(jsonStr); BasicSObjectMetadata metadata = this.objectReader.withType(BasicSObjectMetadata.class).readValue(objectNode.get("objectDescribe")); ArrayNode recentItems = this.objectReader.withType(ArrayNode.class).readValue(objectNode.get("recentItems")); List<SObject> sObjects = getSObjects(recentItems.elements()); return new BasicSObjectMetadataResult(metadata, sObjects); } 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 BasicSObjectMetadataResult getBasicObjectInfo(String sObjectType) throws IOException { Timer.Context context = basicSObjectInfoTimer.time(); String jsonStr; try { jsonStr = this.getHttpApiClient().basicSObjectInfo(sObjectType); } finally { context.stop(); } ObjectNode objectNode = this.objectReader.withType(ObjectNode.class).readValue(jsonStr); BasicSObjectMetadata metadata = this.objectReader.withType(BasicSObjectMetadata.class).readValue(objectNode.get("objectDescribe")); ArrayNode recentItems = this.objectReader.withType(ArrayNode.class).readValue(objectNode.get("recentItems")); List<SObject> sObjects = getSObjects(recentItems.elements()); return new BasicSObjectMetadataResult(metadata, sObjects); } 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);  }