@Before
public void setupSecurity() {
List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
for (Entitlement entitlement : entitlementDAO.findAll()) {
authorities.add(new SimpleGrantedAuthority(entitlement.getName()));
}
UserDetails userDetails = new User(adminUser, "FAKE_PASSWORD", true, true, true, true, authorities);
Authentication authentication = new TestingAuthenticationToken(userDetails, "FAKE_PASSWORD", authorities);
SecurityContextHolder.getContext().setAuthentication(authentication);