use of com.cribbstechnologies.clients.mandrill.exception.RequestFailedException in project Java-Mandrill-Wrapper by cribbstechnologies.
the class TemplatesTest method testUpdateTemplate.
@Test
public void testUpdateTemplate() {
MandrillRequestWithCode request = new MandrillRequestWithCode();
request.setName("template1");
String newVal = "<html><body>Not template</body></html>";
request.setCode(newVal);
MandrillRequestWithName retrieve = new MandrillRequestWithName();
retrieve.setName("template1");
try {
TemplateResponse response = templatesRequest.getTemplateInfo(retrieve);
String oldVal = response.getCode();
templatesRequest.updateTemplate(request);
response = templatesRequest.getTemplateInfo(retrieve);
assertFalse(oldVal.equals(newVal));
assertEquals(newVal, response.getCode());
} catch (RequestFailedException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
use of com.cribbstechnologies.clients.mandrill.exception.RequestFailedException in project Java-Mandrill-Wrapper by cribbstechnologies.
the class UrlsTest method testGetTimeSeries.
@Test
public void testGetTimeSeries() {
MandrillRequestWithUrl request = new MandrillRequestWithUrl();
request.setUrl("http://www.google.com");
try {
UrlListResponse response = urlsRequest.getTimeSeries(request);
} catch (RequestFailedException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
use of com.cribbstechnologies.clients.mandrill.exception.RequestFailedException in project Java-Mandrill-Wrapper by cribbstechnologies.
the class UsersTest method testVerifySender.
@Test
public void testVerifySender() {
MandrillRequestWithEmail emailRequest = new MandrillRequestWithEmail();
emailRequest.setEmail(props.getProperty("verify.email"));
try {
VerifyResponse response = usersRequest.verifySender(emailRequest);
} catch (RequestFailedException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
use of com.cribbstechnologies.clients.mandrill.exception.RequestFailedException in project Java-Mandrill-Wrapper by cribbstechnologies.
the class UsersTest method testDisableSender.
@Test
public void testDisableSender() {
MandrillRequestWithDomain domainRequest = new MandrillRequestWithDomain();
domainRequest.setDomain("google.com");
try {
DisableResponse response = usersRequest.disableSender(domainRequest);
} catch (RequestFailedException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
use of com.cribbstechnologies.clients.mandrill.exception.RequestFailedException in project Java-Mandrill-Wrapper by cribbstechnologies.
the class UsersTest method testPing2.
@Test
public void testPing2() {
BaseMandrillRequest baseRequest = new BaseMandrillRequest();
try {
PingResponse pingResponse = usersRequest.performPing2(baseRequest);
assertEquals("PONG!", pingResponse.getPingResponse());
} catch (RequestFailedException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
Aggregations