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.
This commit is contained in:
Chris Earle 2016-08-22 20:40:31 -04:00
parent 68b943dc53
commit e171d0e0a8
4 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ import java.util.Objects;
* Holds an elasticsearch response. It wraps the {@link HttpResponse} returned and associates it with
* its corresponding {@link RequestLine} and {@link HttpHost}.
*/
public final class Response {
public class Response {
private final RequestLine requestLine;
private final HttpHost host;

View File

@ -33,7 +33,7 @@ public final class ResponseException extends IOException {
private Response response;
ResponseException(Response response) throws IOException {
public ResponseException(Response response) throws IOException {
super(buildMessage(response));
this.response = response;
}

View File

@ -77,7 +77,7 @@ import java.util.concurrent.atomic.AtomicReference;
*
* Requests can be traced by enabling trace logging for "tracer". The trace logger outputs requests and responses in curl format.
*/
public final class RestClient implements Closeable {
public class RestClient implements Closeable {
private static final Log logger = LogFactory.getLog(RestClient.class);

View File

@ -42,7 +42,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
* {@link RestClientBuilder#setFailureListener(RestClient.FailureListener)}. The Sniffer implementation needs to be lazily set to the
* previously created SniffOnFailureListener through {@link SniffOnFailureListener#setSniffer(Sniffer)}.
*/
public final class Sniffer implements Closeable {
public class Sniffer implements Closeable {
private static final Log logger = LogFactory.getLog(Sniffer.class);