expression.getValue(context);
}
@Test
public void testOauthClient() throws Exception {
AuthorizationRequest request = new AuthorizationRequest("foo", Collections.singleton("read"));
request.setResourceIdsAndAuthoritiesFromClientDetails(new BaseClientDetails("foo", "", "",
"client_credentials", "ROLE_CLIENT"));
Authentication userAuthentication = null;
OAuth2Request clientAuthentication = RequestTokenFactory
.createOAuth2Request(request.getRequestParameters(), request.getClientId(), request.getAuthorities(),
request.isApproved(), request.getScope(), request.getResourceIds(), request.getRedirectUri(),
request.getResponseTypes(), request.getExtensions());
OAuth2Authentication oAuth2Authentication = new OAuth2Authentication(clientAuthentication, userAuthentication);
MethodInvocation invocation = new SimpleMethodInvocation(this, ReflectionUtils.findMethod(getClass(),
"testOauthClient"));
EvaluationContext context = handler.createEvaluationContext(oAuth2Authentication, invocation);