-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathDomainTest.java
More file actions
69 lines (57 loc) · 2.72 KB
/
DomainTest.java
File metadata and controls
69 lines (57 loc) · 2.72 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package integration;
import base.BaseTest;
import com.postmarkapp.postmark.client.AccountApiClient;
import com.postmarkapp.postmark.client.Parameters;
import com.postmarkapp.postmark.client.data.model.domains.DomainDetails;
import com.postmarkapp.postmark.client.data.model.domains.Domains;
import com.postmarkapp.postmark.client.exception.PostmarkException;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.*;
/**
* Created by bash on 11/14/17.
*/
public class DomainTest extends BaseTest {
AccountApiClient client = getDefaultAccountApiClient();
@Test
void list() throws PostmarkException, IOException {
Domains domains = client.getDomains(Parameters.init().build("count",6).build("offset",0));
assertTrue(domains.getDomains().size() > 0);
}
@Test
void listById() throws PostmarkException, IOException {
Domains domains = client.getDomains(Parameters.init().build("count",6).build("offset",0));
Integer domainId = domains.getDomains().get(0).getId();
DomainDetails domainDetails = client.getDomainDetails(domainId);
assertNotNull(domainDetails.getDkimTextValue());
}
@Test
void verifySPF() throws PostmarkException, IOException {
Domains domains = client.getDomains(Parameters.init().build("count",6).build("offset",0));
Integer domainId = domains.getDomains().get(0).getId();
String response = client.verifyDomainSPF(domainId);
assertNotNull(response);
}
@Test
void verifyDKIM() throws PostmarkException, IOException {
Domains domains = client.getDomains(Parameters.init().build("count",6).build("offset",0));
Integer domainId = domains.getDomains().get(0).getId();
DomainDetails domainDetails = client.verifyDomainDKIM(domainId);
assertNotNull(domainDetails.getDkimTextValue());
}
@Test
void verifyReturnPath() throws PostmarkException, IOException {
Domains domains = client.getDomains(Parameters.init().build("count",6).build("offset",0));
Integer domainId = domains.getDomains().get(0).getId();
DomainDetails domainDetails = client.verifyDomainReturnPath(domainId);
assertNotNull(domainDetails.getDkimTextValue());
}
@Test
void verifyDomainCustomTracking() throws PostmarkException, IOException {
Domains domains = client.getDomains(Parameters.init().build("count",6).build("offset",0));
Integer domainId = domains.getDomains().get(0).getId();
DomainDetails domainDetails = client.verifyDomainCustomTracking(domainId);
assertNotNull(domainDetails.getCustomTrackingDomainCNAMEValue());
assertFalse(domainDetails.getCustomTrackingVerified());
}
}