Skip to content

Commit ed61ca6

Browse files
Version Bump v2.2.1: Set client properly when testing
1 parent 46433e7 commit ed61ca6

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33

44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## [2.2.1] - 2016-06-08
7+
### Fixed
8+
- Set client properly when testing
9+
610
## [2.2.0] - 2016-06-08
711
### Added
812
- Can pass test flag to allow for http calls

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ source ./sendgrid.env
8787
```
8888

8989
```bash
90-
./gradelew build
90+
./gradlew build
9191
cd examples
92-
javac -classpath ./commons-logging-1.2.jar:./httpcore-4.4.4.jar:./httpclient-4.5.2.jar:./jackson-databind-2.7.3.jar:./jackson-annotations-2.7.0.jar:./jackson-core-2.7.3.jar:../repo/com/sendgrid/2.0.0/sendgrid-java-http-client-2.0.0-jar.jar:. Example.java && java -classpath ./commons-logging-1.2.jar:./httpcore-4.4.4.jar:./httpclient-4.5.2.jar:./jackson-databind-2.7.3.jar:./jackson-annotations-2.7.0.jar:./jackson-core-2.7.3.jar:../repo/com/sendgrid/2.0.0/sendgrid-java-http-client-2.0.0-jar.jar:. Example
92+
javac -classpath ./commons-logging-1.2.jar:./httpcore-4.4.4.jar:./httpclient-4.5.2.jar:./jackson-databind-2.7.3.jar:./jackson-annotations-2.7.0.jar:./jackson-core-2.7.3.jar:../repo/com/sendgrid/2.2.0/sendgrid-java-http-client-2.2.1-jar.jar:. Example.java && java -classpath ./commons-logging-1.2.jar:./httpcore-4.4.4.jar:./httpclient-4.5.2.jar:./jackson-databind-2.7.3.jar:./jackson-annotations-2.7.0.jar:./jackson-core-2.7.3.jar:../repo/com/sendgrid/2.2.0/sendgrid-java-http-client-2.2.1-jar.jar:. Example
9393
```
9494

9595
<a name="understanding_the_codebase"></a>

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ All updates to this project is documented in our [CHANGELOG](https://github.com/
1616
...
1717
dependencies {
1818
...
19-
compile 'com.sendgrid:java-http-client:2.2.0'
19+
compile 'com.sendgrid:java-http-client:2.2.1'
2020
}
2121
2222
repositories {
@@ -31,15 +31,15 @@ repositories {
3131
<dependency>
3232
<groupId>com.sendgrid</groupId>
3333
<artifactId>java-http-client</artifactId>
34-
<version>2.2.0</version>
34+
<version>2.2.1</version>
3535
</dependency>
3636
```
3737

3838
`mvn install`
3939

4040
## Fat Jar
4141

42-
[Download](http://repo1.maven.org/maven2/com/sendgrid/java-http-client/2.2.0/java-http-client-2.2.0-jar.jar)
42+
[Download](http://repo1.maven.org/maven2/com/sendgrid/java-http-client/2.2.1/java-http-client-2.2.1-jar.jar)
4343

4444
## Dependencies
4545

@@ -113,7 +113,7 @@ source ./sendgrid.env
113113
```bash
114114
mvn package
115115
cd examples
116-
javac -classpath ./jackson-databind-2.7.3.jar:./jackson-annotations-2.7.0.jar:./jackson-core-2.7.3.jar:/{path_to}/java-http-client-2.0.0-jar.jar:. Example.java && java -classpath ./jackson-databind-2.7.3.jar:./jackson-annotations-2.7.0.jar:./jackson-core-2.7.3.jar:/{path_to}/java-http-client-2.0.0-jar.jar:. Example
116+
javac -classpath ./jackson-databind-2.7.3.jar:./jackson-annotations-2.7.0.jar:./jackson-core-2.7.3.jar:/{path_to}/java-http-client-2.2.1-jar.jar:. Example.java && java -classpath ./jackson-databind-2.7.3.jar:./jackson-annotations-2.7.0.jar:./jackson-core-2.7.3.jar:/{path_to}/java-http-client-2.2.1-jar.jar:. Example
117117
```
118118

119119
## Roadmap

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ apply plugin: 'maven'
1717
apply plugin: 'signing'
1818

1919
group = 'com.sendgrid'
20-
version = '2.2.0'
20+
version = '2.2.1'
2121
ext.packaging = 'jar'
2222

2323
allprojects {

src/main/java/com/sendgrid/Client.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public Client(CloseableHttpClient httpClient) {
8282
* @param test is a Bool
8383
*/
8484
public Client(Boolean test) {
85+
this.httpClient = HttpClients.createDefault();
8586
this.test = test;
8687
}
8788

@@ -105,6 +106,7 @@ public URI buildUri(String baseUri, String endpoint, Map<String,String> queryPar
105106

106107
builder.setHost(baseUri);
107108
builder.setPath(endpoint);
109+
108110
if (queryParams != null) {
109111
for (Map.Entry<String, String> entry : queryParams.entrySet()) {
110112
builder.setParameter(entry.getKey(), entry.getValue());
@@ -168,7 +170,6 @@ public Response get(Request request) throws URISyntaxException, IOException {
168170
}
169171
}
170172

171-
172173
try {
173174
serverResponse = httpClient.execute(httpGet);
174175
response = getResponse(serverResponse);

0 commit comments

Comments
 (0)