use of org.springframework.security.oauth.provider.ConsumerCredentials in project spring-security-oauth by spring-projects.
the class AccessTokenProcessingFilterTests method testCreateOAuthToken.
/**
* tests creating the oauth token.
*/
@Test
public void testCreateOAuthToken() throws Exception {
ConsumerCredentials creds = new ConsumerCredentials("key", "sig", "meth", "base", "tok");
when(consumerDetails.getAuthorities()).thenReturn(new ArrayList<GrantedAuthority>());
AccessTokenProcessingFilter filter = new AccessTokenProcessingFilter();
filter.setTokenServices(tokenServices);
when(tokenServices.createAccessToken("tok")).thenReturn(token);
ConsumerAuthentication authentication = new ConsumerAuthentication(consumerDetails, creds);
assertSame(token, filter.createOAuthToken(authentication));
}
Aggregations