use of org.springframework.security.oauth.provider.filter.AccessTokenProcessingFilter in project spring-security-oauth by spring-projects.
the class AccessTokenProcessingFilterTests method testOnNewTimestamp.
/**
* tests the logic on a new timestamp.
*/
@Test
public void testOnNewTimestamp() throws Exception {
try {
new AccessTokenProcessingFilter().onNewTimestamp();
fail();
} catch (InvalidOAuthParametersException e) {
// fall through
}
}
use of org.springframework.security.oauth.provider.filter.AccessTokenProcessingFilter 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