ContactsResource extends Resource { public CallSpec<List<XingUser>, HttpError> getSharedContacts(String userId) { return Resource.<List<XingUser>, HttpError>newGetSpec(api, "/v1/users/{user_id}/contacts/shared") .pathParam("user_id", userId) .responseAs(list(XingUser.class, "shared_contacts", "users")) .build(); } ContactsResource(XingApi api); CallSpec<List<XingUser>, HttpError> getUserContacts(String userId); CallSpec<List<XingUser>, HttpError> getOwnContacts(); CallSpec<List<String>, HttpError> getOwnContactsIds(); CallSpec<List<String>, HttpError> getAssignedTags(String userId, String contactId); CallSpec<List<String>, HttpError> getOwnAssignedTags(String contactId); CallSpec<List<XingUser>, HttpError> getSharedContacts(String userId); @Experimental CallSpec<List<XingUser>, HttpError> getUpcomingBirthdays(); CallSpec<List<ContactRequest>, HttpError> getIncomingContactRequests(); CallSpec<List<PendingContactRequest>, HttpError> getPendingContactRequests(); CallSpec<Void, HttpError> sendContactRequest(String userId); CallSpec<Void, HttpError> acceptContactRequest(String recipientId, String senderId); CallSpec<Void, HttpError> revokeContactRequest(String recipientId, String senderId); CallSpec<ContactPaths, HttpError> getContactPaths(String userId, String otherUserId); CallSpec<InvitationStats, HttpError> inviteByMail(String... emails);  }
@Test public void getSharedContacts() throws Exception { server.enqueue(new MockResponse().setBody("{\n" + " \"shared_contacts\": {\n" + " \"total\": 47,\n" + " \"users\": [\n" + LIST_OF_USERS + " ]\n" + " }\n" + '}')); Response<List<XingUser>, HttpError> response = resource.getSharedContacts("contact_id").execute(); assertThat(response.body().size()).isEqualTo(5); }