Merge branch '1.2.x'
This commit is contained in:
@@ -36,9 +36,9 @@ public class SampleSecureApplication implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
SecurityContextHolder.getContext().setAuthentication(
|
||||
new UsernamePasswordAuthenticationToken("user", "N/A", AuthorityUtils
|
||||
.commaSeparatedStringToAuthorityList("ROLE_USER")));
|
||||
SecurityContextHolder.getContext()
|
||||
.setAuthentication(new UsernamePasswordAuthenticationToken("user", "N/A",
|
||||
AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_USER")));
|
||||
try {
|
||||
System.out.println(this.service.secure());
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ public class SampleSecureApplicationTests {
|
||||
public void init() {
|
||||
AuthenticationManager authenticationManager = this.context
|
||||
.getBean(AuthenticationManager.class);
|
||||
this.authentication = authenticationManager
|
||||
.authenticate(new UsernamePasswordAuthenticationToken("user", "password"));
|
||||
this.authentication = authenticationManager.authenticate(
|
||||
new UsernamePasswordAuthenticationToken("user", "password"));
|
||||
}
|
||||
|
||||
@After
|
||||
|
||||
Reference in New Issue
Block a user