Skip to content

Commit a77755d

Browse files
Fixed local tests and updated dependency
1 parent 20c0bc6 commit a77755d

4 files changed

Lines changed: 910 additions & 431 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ buildscript {
4545
}
4646

4747
dependencies {
48-
compile 'com.sendgrid:java-http-client:2.1.0'
48+
compile 'com.sendgrid:java-http-client:2.2.1'
4949
compile 'com.fasterxml.jackson.core:jackson-core:2.5.3'
5050
compile 'com.fasterxml.jackson.core:jackson-annotations:2.5.3'
5151
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.3'

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<dependency>
9090
<groupId>com.sendgrid</groupId>
9191
<artifactId>java-http-client</artifactId>
92-
<version>2.1.0</version>
92+
<version>2.2.1</version>
9393
</dependency>
9494
<dependency>
9595
<groupId>com.fasterxml.jackson.core</groupId>

src/main/java/com/sendgrid/SendGrid.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,22 @@ public class SendGrid {
2626
* @param apiKey is your SendGrid API Key: https://app.sendgrid.com/settings/api_keys
2727
*/
2828
public SendGrid(String apiKey) {
29+
this.client = new Client();
30+
initializeSendGrid(apiKey);
31+
}
32+
33+
/**
34+
* @param apiKey is your SendGrid API Key: https://app.sendgrid.com/settings/api_keys
35+
*/
36+
public SendGrid(String apiKey, Boolean test) {
37+
this.client = new Client(test);
38+
initializeSendGrid(apiKey);
39+
}
40+
41+
public void initializeSendGrid(String apiKey) {
2942
this.apiKey = apiKey;
3043
this.host = "api.sendgrid.com";
3144
this.version = "v3";
32-
this.client = new Client();
3345
this.requestHeaders = new HashMap<String, String>();
3446
this.requestHeaders.put("Authorization", "Bearer " + apiKey);
3547
this.requestHeaders.put("Content-Type", "application/json");

0 commit comments

Comments
 (0)