use of org.springframework.security.userdetails.memory.UserAttribute in project gocd by gocd.
the class AnonymousProcessingFilterTest method setUp.
@Before
public void setUp() {
filter = new AnonymousProcessingFilter(goConfigService);
filter.setKey("anonymousKey");
UserAttribute userAttribute = createUserAttribute();
filter.setUserAttribute(userAttribute);
}
use of org.springframework.security.userdetails.memory.UserAttribute in project gocd by gocd.
the class AnonymousProcessingFilter method setUserAttributeWithRole.
private void setUserAttributeWithRole(final String role) {
final UserAttribute initialAttribute = new UserAttribute();
initialAttribute.setPassword("anonymousUser");
initialAttribute.setAuthorities(new ArrayList() {
{
add(new GrantedAuthorityImpl(role));
}
});
setUserAttribute(initialAttribute);
}
use of org.springframework.security.userdetails.memory.UserAttribute in project gocd by gocd.
the class AnonymousProcessingFilterTest method createUserAttribute.
private UserAttribute createUserAttribute() {
UserAttribute userAttribute = new UserAttribute();
userAttribute.setAuthoritiesAsString(new ArrayList<String>() {
{
add("ROLE_ASSHOLE");
}
});
userAttribute.setPassword("anonymousPassword");
return userAttribute;
}
Aggregations