Authentication userAuthentication = null;
OAuth2Authentication oAuth2Authentication = new OAuth2Authentication(clientAuthentication, userAuthentication);
MethodInvocation invocation = new SimpleMethodInvocation(this, ReflectionUtils.findMethod(getClass(),
"testOauthClient"));
EvaluationContext context = handler.createEvaluationContext(oAuth2Authentication, invocation);
Expression expression = handler.getExpressionParser().parseExpression(
"#oauth2.hasScopeMatching('.*_admin:read')");
assertTrue((Boolean) expression.getValue(context));
expression = handler.getExpressionParser().parseExpression(
"#oauth2.hasAnyScopeMatching('.*_admin:write','.*_admin:read')");
assertTrue((Boolean) expression.getValue(context));
}