@Test public void showContactsList() { ListContactsResponse contacts = mailjet.showContacts(); log.debug("Contacts {}", contacts); assertNotNull(contacts); }
public ListContactsResponse showContacts() { HttpGet httpGet = new HttpGet(apiUri + "contactList/?output=json"); try { log.info("sending request to mailjet to show all contacts"); HttpResponse httpResponse = httpClient.execute(httpGet); if (httpResponse.getStatusLine().getStatusCode() != 200 ) throw new IOException(String.format("throw Http Error %s", httpResponse.getStatusLine().getReasonPhrase()) ); final String responseContent = IOUtils.toString(httpResponse.getEntity().getContent()); return mapper.readValue(responseContent, ListContactsResponse.class); } catch (Exception ex) { throw new RuntimeException("Error when building request to mailjet ", ex); } }
Mailjet implements Serializable { public ListContactsResponse showContacts() { HttpGet httpGet = new HttpGet(apiUri + "contactList/?output=json"); try { log.info("sending request to mailjet to show all contacts"); HttpResponse httpResponse = httpClient.execute(httpGet); if (httpResponse.getStatusLine().getStatusCode() != 200 ) throw new IOException(String.format("throw Http Error %s", httpResponse.getStatusLine().getReasonPhrase()) ); final String responseContent = IOUtils.toString(httpResponse.getEntity().getContent()); return mapper.readValue(responseContent, ListContactsResponse.class); } catch (Exception ex) { throw new RuntimeException("Error when building request to mailjet ", ex); } } }
Mailjet implements Serializable { public ListContactsResponse showContacts() { HttpGet httpGet = new HttpGet(apiUri + "contactList/?output=json"); try { log.info("sending request to mailjet to show all contacts"); HttpResponse httpResponse = httpClient.execute(httpGet); if (httpResponse.getStatusLine().getStatusCode() != 200 ) throw new IOException(String.format("throw Http Error %s", httpResponse.getStatusLine().getReasonPhrase()) ); final String responseContent = IOUtils.toString(httpResponse.getEntity().getContent()); return mapper.readValue(responseContent, ListContactsResponse.class); } catch (Exception ex) { throw new RuntimeException("Error when building request to mailjet ", ex); } } Mailjet(MailjetManager mailjetManager);  Mailjet(); }
Mailjet implements Serializable { public ListContactsResponse showContacts() { HttpGet httpGet = new HttpGet(apiUri + "contactList/?output=json"); try { log.info("sending request to mailjet to show all contacts"); HttpResponse httpResponse = httpClient.execute(httpGet); if (httpResponse.getStatusLine().getStatusCode() != 200 ) throw new IOException(String.format("throw Http Error %s", httpResponse.getStatusLine().getReasonPhrase()) ); final String responseContent = IOUtils.toString(httpResponse.getEntity().getContent()); return mapper.readValue(responseContent, ListContactsResponse.class); } catch (Exception ex) { throw new RuntimeException("Error when building request to mailjet ", ex); } } Mailjet(MailjetManager mailjetManager);  Mailjet(); @Deprecated AddContactResponse addContact(long listId, String email); boolean insertContact(long listId, String email); AddContactResponse addContacts(String id, List<String> emails); ListContactsResponse showContacts(); String getErrorMessage(); void setErrorMessage(String errorMessage); AddContactResponse getAddContactRespone(); void setAddContactRespone(AddContactResponse addContactRespone); }
Mailjet implements Serializable { public ListContactsResponse showContacts() { HttpGet httpGet = new HttpGet(apiUri + "contactList/?output=json"); try { log.info("sending request to mailjet to show all contacts"); HttpResponse httpResponse = httpClient.execute(httpGet); if (httpResponse.getStatusLine().getStatusCode() != 200 ) throw new IOException(String.format("throw Http Error %s", httpResponse.getStatusLine().getReasonPhrase()) ); final String responseContent = IOUtils.toString(httpResponse.getEntity().getContent()); return mapper.readValue(responseContent, ListContactsResponse.class); } catch (Exception ex) { throw new RuntimeException("Error when building request to mailjet ", ex); } } Mailjet(MailjetManager mailjetManager);  Mailjet(); @Deprecated AddContactResponse addContact(long listId, String email); boolean insertContact(long listId, String email); AddContactResponse addContacts(String id, List<String> emails); ListContactsResponse showContacts(); String getErrorMessage(); void setErrorMessage(String errorMessage); AddContactResponse getAddContactRespone(); void setAddContactRespone(AddContactResponse addContactRespone);  }