Skip to content

Commit ff020fa

Browse files
committed
Removes TRAVIS related logic from 10 tests.
1 parent 25fafa8 commit ff020fa

File tree

1 file changed

+20
-80
lines changed

1 file changed

+20
-80
lines changed

src/test/java/com/sendgrid/SendGridTest.java

Lines changed: 20 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -4159,14 +4159,8 @@ public void test_user_webhooks_parse_stats_get() throws IOException {
41594159

41604160
@Test
41614161
public void test_whitelabel_domains_post() throws IOException {
4162-
SendGrid sg = null;
4163-
if(System.getenv("TRAVIS") != null && Boolean.parseBoolean(System.getenv("TRAVIS"))) {
4164-
sg = new SendGrid("SENDGRID_API_KEY");
4165-
sg.setHost(System.getenv("MOCK_HOST"));
4166-
} else {
4167-
sg = new SendGrid("SENDGRID_API_KEY", true);
4168-
sg.setHost("localhost:4010");
4169-
}
4162+
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
4163+
sg.setHost("localhost:4010");
41704164
sg.addRequestHeader("X-Mock", "201");
41714165

41724166
Request request = new Request();
@@ -4179,14 +4173,8 @@ public void test_whitelabel_domains_post() throws IOException {
41794173

41804174
@Test
41814175
public void test_whitelabel_domains_get() throws IOException {
4182-
SendGrid sg = null;
4183-
if(System.getenv("TRAVIS") != null && Boolean.parseBoolean(System.getenv("TRAVIS"))) {
4184-
sg = new SendGrid("SENDGRID_API_KEY");
4185-
sg.setHost(System.getenv("MOCK_HOST"));
4186-
} else {
4187-
sg = new SendGrid("SENDGRID_API_KEY", true);
4188-
sg.setHost("localhost:4010");
4189-
}
4176+
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
4177+
sg.setHost("localhost:4010");
41904178
sg.addRequestHeader("X-Mock", "200");
41914179

41924180
Request request = new Request();
@@ -4203,14 +4191,8 @@ public void test_whitelabel_domains_get() throws IOException {
42034191

42044192
@Test
42054193
public void test_whitelabel_domains_default_get() throws IOException {
4206-
SendGrid sg = null;
4207-
if(System.getenv("TRAVIS") != null && Boolean.parseBoolean(System.getenv("TRAVIS"))) {
4208-
sg = new SendGrid("SENDGRID_API_KEY");
4209-
sg.setHost(System.getenv("MOCK_HOST"));
4210-
} else {
4211-
sg = new SendGrid("SENDGRID_API_KEY", true);
4212-
sg.setHost("localhost:4010");
4213-
}
4194+
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
4195+
sg.setHost("localhost:4010");
42144196
sg.addRequestHeader("X-Mock", "200");
42154197

42164198
Request request = new Request();
@@ -4222,14 +4204,8 @@ public void test_whitelabel_domains_default_get() throws IOException {
42224204

42234205
@Test
42244206
public void test_whitelabel_domains_subuser_get() throws IOException {
4225-
SendGrid sg = null;
4226-
if(System.getenv("TRAVIS") != null && Boolean.parseBoolean(System.getenv("TRAVIS"))) {
4227-
sg = new SendGrid("SENDGRID_API_KEY");
4228-
sg.setHost(System.getenv("MOCK_HOST"));
4229-
} else {
4230-
sg = new SendGrid("SENDGRID_API_KEY", true);
4231-
sg.setHost("localhost:4010");
4232-
}
4207+
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
4208+
sg.setHost("localhost:4010");
42334209
sg.addRequestHeader("X-Mock", "200");
42344210

42354211
Request request = new Request();
@@ -4241,14 +4217,8 @@ public void test_whitelabel_domains_subuser_get() throws IOException {
42414217

42424218
@Test
42434219
public void test_whitelabel_domains_subuser_delete() throws IOException {
4244-
SendGrid sg = null;
4245-
if(System.getenv("TRAVIS") != null && Boolean.parseBoolean(System.getenv("TRAVIS"))) {
4246-
sg = new SendGrid("SENDGRID_API_KEY");
4247-
sg.setHost(System.getenv("MOCK_HOST"));
4248-
} else {
4249-
sg = new SendGrid("SENDGRID_API_KEY", true);
4250-
sg.setHost("localhost:4010");
4251-
}
4220+
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
4221+
sg.setHost("localhost:4010");
42524222
sg.addRequestHeader("X-Mock", "204");
42534223

42544224
Request request = new Request();
@@ -4260,14 +4230,8 @@ public void test_whitelabel_domains_subuser_delete() throws IOException {
42604230

42614231
@Test
42624232
public void test_whitelabel_domains__domain_id__patch() throws IOException {
4263-
SendGrid sg = null;
4264-
if(System.getenv("TRAVIS") != null && Boolean.parseBoolean(System.getenv("TRAVIS"))) {
4265-
sg = new SendGrid("SENDGRID_API_KEY");
4266-
sg.setHost(System.getenv("MOCK_HOST"));
4267-
} else {
4268-
sg = new SendGrid("SENDGRID_API_KEY", true);
4269-
sg.setHost("localhost:4010");
4270-
}
4233+
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
4234+
sg.setHost("localhost:4010");
42714235
sg.addRequestHeader("X-Mock", "200");
42724236

42734237
Request request = new Request();
@@ -4280,14 +4244,8 @@ public void test_whitelabel_domains__domain_id__patch() throws IOException {
42804244

42814245
@Test
42824246
public void test_whitelabel_domains__domain_id__get() throws IOException {
4283-
SendGrid sg = null;
4284-
if(System.getenv("TRAVIS") != null && Boolean.parseBoolean(System.getenv("TRAVIS"))) {
4285-
sg = new SendGrid("SENDGRID_API_KEY");
4286-
sg.setHost(System.getenv("MOCK_HOST"));
4287-
} else {
4288-
sg = new SendGrid("SENDGRID_API_KEY", true);
4289-
sg.setHost("localhost:4010");
4290-
}
4247+
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
4248+
sg.setHost("localhost:4010");
42914249
sg.addRequestHeader("X-Mock", "200");
42924250

42934251
Request request = new Request();
@@ -4299,14 +4257,8 @@ public void test_whitelabel_domains__domain_id__get() throws IOException {
42994257

43004258
@Test
43014259
public void test_whitelabel_domains__domain_id__delete() throws IOException {
4302-
SendGrid sg = null;
4303-
if(System.getenv("TRAVIS") != null && Boolean.parseBoolean(System.getenv("TRAVIS"))) {
4304-
sg = new SendGrid("SENDGRID_API_KEY");
4305-
sg.setHost(System.getenv("MOCK_HOST"));
4306-
} else {
4307-
sg = new SendGrid("SENDGRID_API_KEY", true);
4308-
sg.setHost("localhost:4010");
4309-
}
4260+
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
4261+
sg.setHost("localhost:4010");
43104262
sg.addRequestHeader("X-Mock", "204");
43114263

43124264
Request request = new Request();
@@ -4318,14 +4270,8 @@ public void test_whitelabel_domains__domain_id__delete() throws IOException {
43184270

43194271
@Test
43204272
public void test_whitelabel_domains__domain_id__subuser_post() throws IOException {
4321-
SendGrid sg = null;
4322-
if(System.getenv("TRAVIS") != null && Boolean.parseBoolean(System.getenv("TRAVIS"))) {
4323-
sg = new SendGrid("SENDGRID_API_KEY");
4324-
sg.setHost(System.getenv("MOCK_HOST"));
4325-
} else {
4326-
sg = new SendGrid("SENDGRID_API_KEY", true);
4327-
sg.setHost("localhost:4010");
4328-
}
4273+
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
4274+
sg.setHost("localhost:4010");
43294275
sg.addRequestHeader("X-Mock", "201");
43304276

43314277
Request request = new Request();
@@ -4338,14 +4284,8 @@ public void test_whitelabel_domains__domain_id__subuser_post() throws IOExceptio
43384284

43394285
@Test
43404286
public void test_whitelabel_domains__id__ips_post() throws IOException {
4341-
SendGrid sg = null;
4342-
if(System.getenv("TRAVIS") != null && Boolean.parseBoolean(System.getenv("TRAVIS"))) {
4343-
sg = new SendGrid("SENDGRID_API_KEY");
4344-
sg.setHost(System.getenv("MOCK_HOST"));
4345-
} else {
4346-
sg = new SendGrid("SENDGRID_API_KEY", true);
4347-
sg.setHost("localhost:4010");
4348-
}
4287+
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
4288+
sg.setHost("localhost:4010");
43494289
sg.addRequestHeader("X-Mock", "200");
43504290

43514291
Request request = new Request();

0 commit comments

Comments
 (0)