assertTrue(validate(new Person(30, "Steven"), text));
}
public void testParser39InRoleRule() {
SecurityContext context = new SecurityContextImpl();
GrantedAuthority[] roles = new GrantedAuthority[] { new GrantedAuthorityImpl("ADMIN_ROLE"),
new GrantedAuthorityImpl("USER_ROLE") };
context.setAuthentication(new TestingAuthenticationToken("username", "username", roles));
SecurityContextHolder.setContext(context);
String text = "{firstName: inRole('USER_ROLE') == true : 'Current user must be in USER_ROLE'}";
assertTrue(validate(new Person(30, "Steven"), text));
}