@Test
public void testEnhanceAccessToken() {
OAuth2Authentication authentication = new OAuth2Authentication(createOAuth2Request("foo", null),
userAuthentication);
OAuth2AccessToken token = tokenEnhancer.enhance(new DefaultOAuth2AccessToken("FOO"), authentication);
assertNotNull(token.getValue());
assertEquals("FOO", token.getAdditionalInformation().get(AccessTokenConverter.JTI));
String claims = JwtHelper.decode(token.getValue()).getClaims();
assertTrue("Wrong claims: " + claims, claims.contains("\"" + AccessTokenConverter.JTI + "\""));
assertTrue("Wrong claims: " + claims, claims.contains("\"" + UserAuthenticationConverter.USERNAME + "\""));