UserProfilesResource extends Resource { public CallSpec<XingUser, HttpError> getOwnIdCard() { return Resource.<XingUser, HttpError>newGetSpec(api, "/v1/users/me/id_card") .responseAs(single(XingUser.class, "id_card")) .build(); } UserProfilesResource(XingApi api); CallSpec<List<XingUser>, HttpError> getUsersById(List<String> ids); CallSpec<XingUser, HttpError> getUserById(String id); CallSpec<XingUser, HttpError> getOwnProfile(); CallSpec<XingUser, HttpError> getOwnIdCard(); CallSpec<List<XingUser>, HttpError> findUsersByEmail(List<String> emails); @Experimental CallSpec<List<XingUser>, HttpError> findUsersByKeyword(String keywords); CallSpec<ProfileMessage, HttpError> getUserProfileMessage(String userId); CallSpec<ProfileMessage, HttpError> getOwnProfileMessage(); CallSpec<String, HttpError> getUserLegalInformation(String userId); CallSpec<String, HttpError> getOwnLegalInformation();  }
@Test public void getOwnIdCard() throws Exception { server.enqueue(new MockResponse().setBody("{\n" + " \"id_card\": {\n" + " \"id\": \"test_id\"\n" + " }\n" + '}')); Response<XingUser, HttpError> response = resource.getOwnIdCard().execute(); assertThat(response.body().id()).isEqualTo("test_id"); }