public void testReEvaluationWithDifferentRoot() throws Exception {
Expression expression = handler.getExpressionParser().parseExpression("#oauth2.isClient()");
MethodInvocation invocation = new SimpleMethodInvocation(this, ReflectionUtils.findMethod(getClass(),
"testNonOauthClient"));
Authentication clientAuthentication = new UsernamePasswordAuthenticationToken("foo", "bar");
EvaluationContext context = handler.createEvaluationContext(clientAuthentication, invocation);
assertFalse((Boolean) expression.getValue(context));
OAuth2Request storedOAuth2Request = RequestTokenFactory.createOAuth2Request("foo", true,
Collections.singleton("read"));
OAuth2Authentication oAuth2Authentication = new OAuth2Authentication(storedOAuth2Request, null);
EvaluationContext anotherContext = handler.createEvaluationContext(oAuth2Authentication, invocation);
assertTrue((Boolean) expression.getValue(anotherContext));
}