GenericOAuth20Client extends OAuth20Client { public void setProfileAttrs(final Map<String, String> profileAttrsMap) { this.profileAttrs = profileAttrsMap; } GenericOAuth20Client(); void setAuthUrl(final String authUrl); void setTokenUrl(final String tokenUrl); void setProfileUrl(final String profileUrl); void setProfileNodePath(final String profilePath); void setProfileVerb(final Verb profileVerb); void setProfileAttrs(final Map<String, String> profileAttrsMap); void setCustomParams(final Map<String, String> customParamsMap); void setProfileId(final String profileId); String getScope(); void setScope(final String scope); boolean isWithState(); void setWithState(final boolean withState); String getClientAuthenticationMethod(); void setClientAuthenticationMethod(final String clientAuthenticationMethod);  }
@Test public void setProfileAttrs() throws Exception { GenericOAuth20Client client = new GenericOAuth20Client(); Map map = new HashMap(); map.put(AGE, "Integer|age"); map.put(IS_ADMIN, "Boolean|is_admin"); map.put(BG_COLOR, "Color|bg_color"); map.put(GENDER, "Gender|gender"); map.put(BIRTHDAY, "Locale|birthday"); map.put(ID, "Long|id"); map.put(BLOG, "URI|blog"); client.setProfileAttrs(map); client.setCallbackUrl(CALLBACK_URL); client.init(); Field configurationField = OAuth20Client.class.getDeclaredField("configuration"); configurationField.setAccessible(true); OAuth20Configuration configuration = (OAuth20Configuration) configurationField.get(client); GenericOAuth20ProfileDefinition profileDefinition = (GenericOAuth20ProfileDefinition) configuration.getProfileDefinition(); Method getConverters = ProfileDefinition.class.getDeclaredMethod("getConverters"); getConverters.setAccessible(true); Map<String, AttributeConverter> converters = (Map<String, AttributeConverter>) getConverters.invoke(profileDefinition); assertTrue(converters.get(AGE) instanceof IntegerConverter); assertTrue(converters.get(IS_ADMIN) instanceof BooleanConverter); assertTrue(converters.get(BG_COLOR) instanceof ColorConverter); assertTrue(converters.get(GENDER) instanceof GenderConverter); assertTrue(converters.get(BIRTHDAY) instanceof LocaleConverter); assertTrue(converters.get(ID) instanceof LongConverter); assertTrue(converters.get(BLOG) instanceof UrlConverter); }