use of com.cribbstechnologies.clients.mandrill.model.response.tags.BaseTag in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillTagsRequest method getList.
public TagListResponse getList(BaseMandrillRequest tagsRequest) throws RequestFailedException {
TagListResponse response = new TagListResponse();
response.setList(((BaseMandrillAnonymousListResponse<BaseTag>) request.postRequest(tagsRequest, ServiceMethods.Tags.LIST, TagListResponse.class, nameTagReference)).getList());
return response;
}
use of com.cribbstechnologies.clients.mandrill.model.response.tags.BaseTag in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillRESTRequestTest method testListTagsResponseConversion.
@Test
public void testListTagsResponseConversion() throws IOException {
this.initRequestWithActualMapper();
StringWriter sw = new StringWriter();
IOUtils.copy(this.getClass().getClassLoader().getResourceAsStream("tags/listResponse.txt"), sw);
TypeReference tagListReference = new TypeReference<List<BaseTag>>() {
};
BaseMandrillAnonymousListResponse<BaseTag> response = (BaseMandrillAnonymousListResponse<BaseTag>) this.request.convertAnonymousListResponseData(sw.toString(), TagListResponse.class, tagListReference);
assertEquals(2, response.getList().size());
BaseTag tag = response.getList().get(0);
assertEquals("example tag1", tag.getTag());
assertEquals(1, tag.getSent());
assertEquals(2, tag.getHard_bounces());
assertEquals(3, tag.getSoft_bounces());
assertEquals(4, tag.getRejects());
assertEquals(5, tag.getComplaints());
assertEquals(6, tag.getUnsubs());
assertEquals(7, tag.getOpens());
assertEquals(8, tag.getClicks());
tag = response.getList().get(1);
assertEquals("example tag11", tag.getTag());
assertEquals(11, tag.getSent());
assertEquals(12, tag.getHard_bounces());
assertEquals(13, tag.getSoft_bounces());
assertEquals(14, tag.getRejects());
assertEquals(15, tag.getComplaints());
assertEquals(16, tag.getUnsubs());
assertEquals(17, tag.getOpens());
assertEquals(18, tag.getClicks());
}
Aggregations