forked from sendgrid/sendgrid-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTwilioEmailTest.java
More file actions
29 lines (22 loc) · 797 Bytes
/
TwilioEmailTest.java
File metadata and controls
29 lines (22 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.sendgrid;
import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
public class TwilioEmailTest {
@Test
public void testInitialization() {
final TwilioEmail sg = new TwilioEmail("username", "password");
Assert.assertEquals("email.twilio.com", sg.getHost());
Assert.assertEquals("Basic dXNlcm5hbWU6cGFzc3dvcmQ=", sg.getRequestHeaders().get("Authorization"));
}
@Test
public void testConstructWithClient() throws IOException {
final Client client = mock(Client.class);
final TwilioEmail sg = new TwilioEmail("username", "password", client);
final Request request = new Request();
sg.makeCall(request);
verify(client).api(request);
}
}