1
0
mirror of synced 2026-08-07 02:38:47 +00:00

Anonymous type can be replaced with lambda

This commit is contained in:
Lars Grefer
2019-08-06 23:40:48 +02:00
committed by Josh Cummings
parent 05f42a4995
commit fb39d9c255
53 changed files with 347 additions and 722 deletions
@@ -25,9 +25,6 @@ import org.springframework.security.core.Authentication;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.web.authentication.www.DigestAuthenticationEntryPoint;
import org.springframework.security.web.authentication.www.DigestAuthenticationFilter;
@@ -59,13 +56,8 @@ public class SecurityMockMvcRequestPostProcessorsDigestTests {
entryPoint.setKey("key");
entryPoint.setRealmName("Spring Security");
filter = new DigestAuthenticationFilter();
filter.setUserDetailsService(new UserDetailsService() {
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException {
return new User(username, password, AuthorityUtils
.createAuthorityList("ROLE_USER"));
}
});
filter.setUserDetailsService(username -> new User(username, password, AuthorityUtils
.createAuthorityList("ROLE_USER")));
filter.setAuthenticationEntryPoint(entryPoint);
filter.afterPropertiesSet();
}
@@ -133,4 +125,4 @@ public class SecurityMockMvcRequestPostProcessorsDigestTests {
});
return username;
}
}
}