I'm running automated tests that call the Gmail API.
I'm going to say it (are you ready?): It works on my machine.
But when I run the same tests via Jenkins, I get a SocketTimeoutException: connect timed out error.
Some addresses have been added to the proxy's whitelist (but with no improvement):
accounts.google.comgmail.googleapis.com
Where it fails:
JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance();
String APPLICATION_NAME = "TEST";
final NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
// This one runs ok
Gmail service = new Gmail.Builder(HTTP_TRANSPORT, JSON_FACTORY, getCredentials(HTTP_TRANSPORT))
.setApplicationName(APPLICATION_NAME)
.build();
// It fails here:
ListMessagesResponse response = service.
users().
messages().
list("me").
setQ("subject:" + messageTitle).
execute();
Any help will be very appreciated :)