use of com.cribbstechnologies.clients.mandrill.model.response.tags.TagWithTime in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillTagsRequest method getAllTimeSeries.
public TagSeriesResponse getAllTimeSeries(BaseMandrillRequest tagsRequest) throws RequestFailedException {
TagSeriesResponse response = new TagSeriesResponse();
response.setList(((BaseMandrillAnonymousListResponse<TagWithTime>) request.postRequest(tagsRequest, ServiceMethods.Tags.ALL_TIME_SERIES, TagSeriesResponse.class, timeTagReference)).getList());
return response;
}
use of com.cribbstechnologies.clients.mandrill.model.response.tags.TagWithTime in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillTagsRequest method getTimeSeries.
public TagSeriesResponse getTimeSeries(MandrillRequestWithTag tagsRequest) throws RequestFailedException {
TagSeriesResponse response = new TagSeriesResponse();
response.setList(((BaseMandrillAnonymousListResponse<TagWithTime>) request.postRequest(tagsRequest, ServiceMethods.Tags.TIME_SERIES, TagSeriesResponse.class, timeTagReference)).getList());
return response;
}
use of com.cribbstechnologies.clients.mandrill.model.response.tags.TagWithTime in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillRESTRequestTest method testTimeTagsResponseConversion.
@Test
public void testTimeTagsResponseConversion() throws IOException {
this.initRequestWithActualMapper();
StringWriter sw = new StringWriter();
IOUtils.copy(this.getClass().getClassLoader().getResourceAsStream("tags/timeSeriesResponse.txt"), sw);
TypeReference tagListReference = new TypeReference<List<TagWithTime>>() {
};
BaseMandrillAnonymousListResponse<TagWithTime> response = (BaseMandrillAnonymousListResponse<TagWithTime>) this.request.convertAnonymousListResponseData(sw.toString(), TagSeriesResponse.class, tagListReference);
assertEquals(2, response.getList().size());
TagWithTime tag = response.getList().get(0);
assertEquals("example time1", tag.getTime());
assertEquals(2, tag.getSent());
assertEquals(3, tag.getHard_bounces());
assertEquals(4, tag.getSoft_bounces());
assertEquals(5, tag.getRejects());
assertEquals(6, tag.getComplaints());
assertEquals(7, tag.getOpens());
assertEquals(8, tag.getUnique_opens());
assertEquals(9, tag.getClicks());
assertEquals(10, tag.getUnique_clicks());
tag = response.getList().get(1);
assertEquals("example time11", tag.getTime());
assertEquals(12, tag.getSent());
assertEquals(13, tag.getHard_bounces());
assertEquals(14, tag.getSoft_bounces());
assertEquals(15, tag.getRejects());
assertEquals(16, tag.getComplaints());
assertEquals(17, tag.getOpens());
assertEquals(18, tag.getUnique_opens());
assertEquals(19, tag.getClicks());
assertEquals(110, tag.getUnique_clicks());
}
Aggregations