/** * Returns the legal information for the authorizing {@linkplain XingUser user}. * * @return A {@linkplain CallSpec callSpec} object ready to execute the request. * * @see <a href="https://dev.xing.com/docs/get/users/:user_id/legal_information">'Get legal information of a user' * resource page</a> */ public CallSpec<String, HttpError> getOwnLegalInformation() { return getUserLegalInformation(ME); } }
@Test public void getUserLegalInformation() throws Exception { MockResponse mockResponse = new MockResponse().setBody("{\n" + " \"legal_information\": {\n" + " \"content\": \"Hello there.\"\n" + " }\n" + '}'); // Enqueue twice server.enqueue(mockResponse); server.enqueue(mockResponse); Response<String, HttpError> response1 = resource.getUserLegalInformation("test").execute(); assertThat(response1.body()).isEqualTo("Hello there."); Response<String, HttpError> response2 = resource.getOwnLegalInformation().execute(); assertThat(response2.body()).isEqualTo("Hello there."); } }