GroupServiceThreeLeggedOAuth10a extends AbstractGroupService implements OauthGroupService { @Override public Group20Entry getGroup20Entry(GroupProviderUserOauth oauth, GroupProvider groupProvider, int limit, int offset) { final ThreeLeggedOauth10aGroupProviderApi api = new ThreeLeggedOauth10aGroupProviderApi(groupProvider); final GroupProviderServiceThreeLeggedOAuth10a tls = new GroupProviderServiceThreeLeggedOAuth10a(groupProvider, api); final OAuthService oAuthService = tls.getOAuthService(); Token accessToken = new Token(oauth.getOAuthToken(), oauth.getOAuthSecret()); final String strippedID = convertToExternalPersonId(oauth.getPersonId(), groupProvider); OAuthRequest oAuthRequest = getGroupListOAuthRequest(groupProvider, api, strippedID); oAuthRequest.addQuerystringParameter("startIndex", Integer.toString(offset)); oAuthRequest.addQuerystringParameter("count", Integer.toString(limit)); oAuthService.signRequest(accessToken, oAuthRequest); log.info("About to get group information with group provider {} using URL: {}", groupProvider.getIdentifier(), oAuthRequest); Response oAuthResponse = oAuthRequest.send(); if (oAuthResponse.isSuccessful()) { final Group20Entry entry = getGroup20EntryFromResponse(oAuthResponse.getStream(), groupProvider); log.debug("Got group entry: {}", entry); return entry; } else { log.warn("Fetching external groups for GroupProvider {} for user {} failed with status code {}", groupProvider, oauth.getPersonId(), oAuthResponse.getCode()); log.warn(oAuthResponse.getBody()); } return null; }  @Override Group20Entry getGroup20Entry(GroupProviderUserOauth oauth, GroupProvider groupProvider, int limit, int offset); @Override List<Group20> getGroup20List(GroupProviderUserOauth oauth, GroupProvider provider); @Override Group20 getGroup20(GroupProviderUserOauth oauth, GroupProvider groupProvider, String groupId); @Override List<Person> getGroupMembers(GroupProviderUserOauth oauth, GroupProvider provider, String groupId); @Override GroupMembersEntry getGroupMembersEntry(GroupProviderUserOauth oauth, GroupProvider provider, String groupId,
      int limit, int offset);  }
@Test public void testGetGroup20EntryHz() { super.setResponseResource(new ClassPathResource("hz-groups.json")); final Group20Entry group20Entry = groupService.getGroup20Entry(oauth, provider, 123456, 0); final List<Group20> group20s = group20Entry.getEntry(); assertEquals(3, group20Entry.getTotalResults()); assertEquals(3, group20s.size()); assertEquals("HZG-1042", group20s.get(0).getId()); }