This is an automated email from the ASF dual-hosted git repository. dulvac pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-clients.git
The following commit(s) were added to refs/heads/master by this push: new fdfb5a7 SLING-11279 Fixing to specify exactly expected code on which httpRetr… (#31) fdfb5a7 is described below commit fdfb5a7fff893d8fc5179398e934658b52d05a4d Author: Thierry Ygé <t...@adobe.com> AuthorDate: Mon Jan 15 09:49:21 2024 +0100 SLING-11279 Fixing to specify exactly expected code on which httpRetr… (#31) * SLING-11279 Fixing to specify exactly expected code on which httpRetriesCode will not be effective * Trivial fixing imports --- src/main/java/org/apache/sling/testing/clients/SlingClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/sling/testing/clients/SlingClient.java b/src/main/java/org/apache/sling/testing/clients/SlingClient.java index 12bd96b..0fe571b 100644 --- a/src/main/java/org/apache/sling/testing/clients/SlingClient.java +++ b/src/main/java/org/apache/sling/testing/clients/SlingClient.java @@ -17,6 +17,8 @@ package org.apache.sling.testing.clients; import static org.apache.http.HttpStatus.SC_CREATED; +import static org.apache.http.HttpStatus.SC_NOT_FOUND; +import static org.apache.http.HttpStatus.SC_NOT_IMPLEMENTED; import static org.apache.http.HttpStatus.SC_OK; import java.io.File; @@ -199,7 +201,7 @@ public class SlingClient extends AbstractSlingClient { * @throws ClientException if the request could not be performed */ public boolean exists(String path) throws ClientException { - SlingHttpResponse response = this.doGet(path + ".json"); + SlingHttpResponse response = this.doGet(path + ".json", SC_OK, SC_CREATED, SC_NOT_FOUND,SC_NOT_IMPLEMENTED); final int status = response.getStatusLine().getStatusCode(); return status == SC_OK; }