MessagesResource extends Resource { public CallSpec<String, HttpError> getAttachmentDownloadLink(String conversationId, String attachmentId) { return Resource.<String, HttpError>newPostSpec(api, "/v1/users/me/conversations/{conversation_id}/attachments/{attachment_id}/download", false) .pathParam("conversation_id", conversationId) .pathParam("attachment_id", attachmentId) .responseAs(single(String.class, "download", "url")) .build(); } MessagesResource(XingApi api); CallSpec<List<Conversation>, HttpError> getConversationsByUserId(String userId); CallSpec<Conversation, HttpError> createConversation(String userId, String subject, String content,
          String... recipientIds); CallSpec<Void, HttpError> validateRecipient(String userId); CallSpec<Conversation, HttpError> getSingleConversation(String conversationId, String userId); CallSpec<List<MessageAttachment>, HttpError> getAttachmentsOfConversation(String conversationId); CallSpec<String, HttpError> getAttachmentDownloadLink(String conversationId, String attachmentId); CallSpec<Void, HttpError> markConversationAsRead(String conversationId, String userId); CallSpec<Void, HttpError> markConverastionAsUnread(String conversationId, String userId); CallSpec<List<ConversationMessage>, HttpError> getConversationMessages(String conversationId, String userId); CallSpec<ConversationMessage, HttpError> getSingleConversationMessage(String conversationId, String messageId,
          String userId); CallSpec<Void, HttpError> markMessageAsRead(String conversationId, String messageId, String userId); CallSpec<Void, HttpError> markMessageAsUnread(String conversationId, String messageId, String userId); CallSpec<ConversationMessage, HttpError> sendMessageToConversation(String userId, String conversationId,
          String messageContent); CallSpec<Void, HttpError> deleteConversation(String userId, String conversationId);  }
@Test public void getAttachmentDownloadLink() throws Exception { server.enqueue(new MockResponse().setBody(file("messages/attachment_download.json"))); Response<String, HttpError> response = resource.getAttachmentDownloadLink("123", "4321_xyza").execute(); assertThat(response.body()).isEqualTo("https: + ".com/v1/AUTH_messages/xing-message-production/-a4eq2LSuUUPGbmbUSZCIaSDRrVx8Vc49yYfvXR4mZw?temp_url_sig" + "=873add36a595df38097a2a9de56da1a4ff67cdac&temp_url_expires=1418399892"); }