Search in sources :

Example 1 with MandrillRequestWithTag

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

the class MandrillRESTRequestTest method testGetPostDataMandrillRequestWithTag.

@Test
public void testGetPostDataMandrillRequestWithTag() throws Exception {
    this.initRequestWithActualMapper();
    assertEquals("{\"key\":null,\"tag\":null}", this.request.getPostData(this.emptyTagRequest));
    this.mutableTagRequest = new MandrillRequestWithTag();
    this.mutableTagRequest.setKey("ABC");
    this.mutableTagRequest.setTag("Tag, you're it");
    assertEquals("{\"key\":\"ABC\",\"tag\":\"Tag, you're it\"}", this.request.getPostData(this.mutableTagRequest));
}
Also used : MandrillRequestWithTag(com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithTag) Test(org.junit.Test)

Example 2 with MandrillRequestWithTag

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

the class TagsTest method testGetTimeSeries.

@Test
public void testGetTimeSeries() {
    MandrillRequestWithTag request = new MandrillRequestWithTag();
    request.setTag("tag1");
    try {
        TagSeriesResponse response = tagsRequest.getTimeSeries(request);
    } catch (RequestFailedException e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
}
Also used : RequestFailedException(com.cribbstechnologies.clients.mandrill.exception.RequestFailedException) TagSeriesResponse(com.cribbstechnologies.clients.mandrill.model.response.tags.TagSeriesResponse) MandrillRequestWithTag(com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithTag) Test(org.junit.Test)

Aggregations

MandrillRequestWithTag (com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithTag)2 Test (org.junit.Test)2 RequestFailedException (com.cribbstechnologies.clients.mandrill.exception.RequestFailedException)1 TagSeriesResponse (com.cribbstechnologies.clients.mandrill.model.response.tags.TagSeriesResponse)1