@Test
public void testScopePreserved() {
OAuth2Authentication authentication = new OAuth2Authentication(createOAuth2Request("foo", Collections.singleton("read")),
userAuthentication);
DefaultOAuth2AccessToken original = new DefaultOAuth2AccessToken("FOO");
original.setScope(authentication.getOAuth2Request().getScope());
OAuth2AccessToken token = tokenEnhancer.enhance(original, authentication);
assertNotNull(token.getValue());
assertEquals(Collections.singleton("read"), token.getScope());
}