Skip to content

Commit e171d0e

Browse files
committed
Un-final Core REST Client classes
This removes final from the RestClient, Response, and Sniffer classes so that outside code can mock them. Their constructors are already package private, so there's not much that can go wrong.
1 parent 68b943d commit e171d0e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

client/rest/src/main/java/org/elasticsearch/client/Response.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* Holds an elasticsearch response. It wraps the {@link HttpResponse} returned and associates it with
3333
* its corresponding {@link RequestLine} and {@link HttpHost}.
3434
*/
35-
public final class Response {
35+
public class Response {
3636

3737
private final RequestLine requestLine;
3838
private final HttpHost host;

client/rest/src/main/java/org/elasticsearch/client/ResponseException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public final class ResponseException extends IOException {
3333

3434
private Response response;
3535

36-
ResponseException(Response response) throws IOException {
36+
public ResponseException(Response response) throws IOException {
3737
super(buildMessage(response));
3838
this.response = response;
3939
}

client/rest/src/main/java/org/elasticsearch/client/RestClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
*
7878
* Requests can be traced by enabling trace logging for "tracer". The trace logger outputs requests and responses in curl format.
7979
*/
80-
public final class RestClient implements Closeable {
80+
public class RestClient implements Closeable {
8181

8282
private static final Log logger = LogFactory.getLog(RestClient.class);
8383

client/sniffer/src/main/java/org/elasticsearch/client/sniff/Sniffer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* {@link RestClientBuilder#setFailureListener(RestClient.FailureListener)}. The Sniffer implementation needs to be lazily set to the
4343
* previously created SniffOnFailureListener through {@link SniffOnFailureListener#setSniffer(Sniffer)}.
4444
*/
45-
public final class Sniffer implements Closeable {
45+
public class Sniffer implements Closeable {
4646

4747
private static final Log logger = LogFactory.getLog(Sniffer.class);
4848

0 commit comments

Comments
 (0)