@Test public void testDeleteBadId() throws IOException { try { client.delete("Lead", new Id("00Q7zzz000Kj4Jn")); fail(); } catch (ApiException e) { assertEquals("https: e.getUrl()); assertEquals("Not Found", e.getHttpReason()); assertJsonStringEquals( "[{\"message\":\"Provided external ID field does not exist or is not accessible:" + " 00Q7zzz000Kj4Jn\",\"errorCode\":\"NOT_FOUND\"}]", e.getHttpResponseBody()); assertEquals(404, e.getHttpResponseCode()); List<ApiError> errors = e.getErrors(); assertEquals(1, errors.size()); ApiError apiError = errors.get(0); assertEquals("NOT_FOUND", apiError.getErrorCode()); assertEquals("Provided external ID field does not exist or is not accessible: 00Q7zzz000Kj4Jn", apiError.getMessage()); assertEquals(0, apiError.getFields().size()); } }
void delete(String sObjectType, Id id) throws IOException { executeRequestForString(new HttpDelete(getUri("/sobjects/" + sObjectType + "/" + id))); }
HttpApiClient { void delete(String sObjectType, Id id) throws IOException { executeRequestForString(new HttpDelete(getUri("/sobjects/" + sObjectType + "/" + id))); } }
HttpApiClient { void delete(String sObjectType, Id id) throws IOException { executeRequestForString(new HttpDelete(getUri("/sobjects/" + sObjectType + "/" + id))); } HttpApiClient(@Nonnull String host, @Nonnull String oauthToken, @Nonnull ObjectMapper objectMapper,
            @Nonnull HttpClient client); }
HttpApiClient { void delete(String sObjectType, Id id) throws IOException { executeRequestForString(new HttpDelete(getUri("/sobjects/" + sObjectType + "/" + id))); } HttpApiClient(@Nonnull String host, @Nonnull String oauthToken, @Nonnull ObjectMapper objectMapper,
            @Nonnull HttpClient client);  }
HttpApiClient { void delete(String sObjectType, Id id) throws IOException { executeRequestForString(new HttpDelete(getUri("/sobjects/" + sObjectType + "/" + id))); } HttpApiClient(@Nonnull String host, @Nonnull String oauthToken, @Nonnull ObjectMapper objectMapper,
            @Nonnull HttpClient client);   }