connection.setProxyCredentials(conf.getProxyCredentials());
}
client.setConnection(connection);
// Send a message so we have one
GmailMessage msg = new JavaMailGmailMessage();
msg.setSubject(TEST_MAIL_WITH_ATTACHEMENTS_SUBJECT);
msg.setContentText(TEST_MAIL_WITH_ATTACHEMENT_CONTENT);
msg.addTo(new EmailAddress(conf.getTestRecipient()));
URL url = this.getClass().getClassLoader().getResource(ATTACHEMENT_1_FILENAME);
msg.addAttachement(new File(url.toURI()));
url = this.getClass().getClassLoader().getResource(ATTACHEMENT_2_FILENAME);
msg.addAttachement(new File(url.toURI()));
client.send(msg);
final List<GmailMessage> messages = client.getUnreadMessages();
for (GmailMessage message : messages) {
if (message.getSubject().equals(TEST_MAIL_WITH_ATTACHEMENTS_SUBJECT)) {