Search in sources :

Example 1 with MandrillRequestWithUrl

use of com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithUrl in project Java-Mandrill-Wrapper by cribbstechnologies.

the class MandrillRESTRequestTest method testGetPostDataMandrillRequestWithUrl.

@Test
public void testGetPostDataMandrillRequestWithUrl() throws Exception {
    this.initRequestWithActualMapper();
    assertEquals("{\"key\":null,\"url\":null}", this.request.getPostData(this.emptyUrlRequest));
    this.mutableUrlRequest = new MandrillRequestWithUrl();
    this.mutableUrlRequest.setKey("TEST");
    this.mutableUrlRequest.setUrl("http://www.google.com");
    assertEquals("{\"key\":\"TEST\",\"url\":\"http://www.google.com\"}", this.request.getPostData(this.mutableUrlRequest));
}
Also used : MandrillRequestWithUrl(com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithUrl) Test(org.junit.Test)

Example 2 with MandrillRequestWithUrl

use of com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithUrl 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());
    }
}
Also used : RequestFailedException(com.cribbstechnologies.clients.mandrill.exception.RequestFailedException) MandrillRequestWithUrl(com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithUrl) UrlListResponse(com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse) Test(org.junit.Test)

Aggregations

MandrillRequestWithUrl (com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithUrl)2 Test (org.junit.Test)2 RequestFailedException (com.cribbstechnologies.clients.mandrill.exception.RequestFailedException)1 UrlListResponse (com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse)1