Skip to content

Commit

Permalink
Merge branch 'client_another_ctor' of https://github.com/maximn/java-…
Browse files Browse the repository at this point in the history
…http-client into client_another_ctor
  • Loading branch information
mbernier committed Oct 28, 2017
2 parents c0d64f2 + 801347c commit d186c7f
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/main/java/com/sendgrid/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,17 @@ public class Client {
* Constructor for using the default CloseableHttpClient.
*/
public Client() {
this.httpClient = HttpClients.createDefault();
this.test = false;
this(false);
}

/**
* Constructor for passing in an httpClient for mocking.
* Constructor for passing in an httpClient.
*
* @param httpClient
* an Apache CloseableHttpClient
*/
public Client(CloseableHttpClient httpClient) {
this.httpClient = httpClient;
this.test = false;
this(httpClient, false);
}

/**
Expand All @@ -75,10 +73,23 @@ public Client(CloseableHttpClient httpClient) {
* is a Bool
*/
public Client(Boolean test) {
this.httpClient = HttpClients.createDefault();
this(HttpClients.createDefault(), test);
}

/**
* Constructor for passing in a an httpClient and test parameter to allow for http calls
*
* @param httpClient
* an Apache CloseableHttpClient
* @param test
* is a Bool
*/
public Client(CloseableHttpClient httpClient, Boolean test) {
this.httpClient = httpClient;
this.test = test;
}


/**
* Add query parameters to a URL.
*
Expand Down

0 comments on commit d186c7f

Please sign in to comment.