OpenConextOAuthClientImpl implements OpenConextOAuthClient, InitializingBean { @Override public Person getPerson(String userId, String onBehalfOf) { OAuthRequest request = new OAuthRequest(Verb.GET, environment.getEndpointBaseUrl() + "social/rest/people/" + userId); InputStream in = execute(onBehalfOf, request); return parser.parsePerson(in).getEntry(); } OpenConextOAuthClientImpl(); @Override boolean isAccessTokenGranted(String userId); @Override String getAuthorizationUrl(); @Override void oauthCallback(HttpServletRequest request, String onBehalfOf); @Override Person getPerson(String userId, String onBehalfOf); @Override List<Person> getGroupMembers(String groupId, String onBehalfOf); @Override List<Group> getGroups(String userId, String onBehalfOf); @Override List<Group20> getGroups20(String userId, String onBehalfOf); @Override Group20 getGroup20(String userId, String groupId, String onBehalfOf); void setCallbackUrl(String url); void setConsumerSecret(String secret); void setConsumerKey(String key); void setEndpointBaseUrl(String url); void setVersion(OAuthVersion v); @Override void afterPropertiesSet(); void setRepository(OAuthRepository repository); void getClientAccessToken();  }
@Test public void testGetPerson() { requestHandler.setResource(new ClassPathResource("single-person.json")); Person person = this.client.getPerson(USER_ID, USER_ID); assertEquals("mnice@surfguest.nl", person.getEmails().iterator().next() .getValue()); }
@Test public void testGetPersonServerOutput() { requestHandler.setResource(new ClassPathResource("single-person-server-output.json")); Person person = this.client.getPerson(USER_ID, null); assertEquals("mFoo@surfguest.nl", person.getEmails().iterator().next() .getValue()); }