Upgrade to Spring Boot 2.6.0-M3.
This commit is contained in:
committed by
Greg L. Turnquist
parent
fc8cdbe864
commit
a171e33444
@@ -15,15 +15,8 @@
|
||||
*/
|
||||
package example;
|
||||
|
||||
import example.users.Password;
|
||||
import example.users.UserManagement;
|
||||
import example.users.Username;
|
||||
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -55,19 +48,6 @@ public class Application {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
@Autowired UserManagement userManagement;
|
||||
|
||||
/**
|
||||
* Creates a few sample users.
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
|
||||
IntStream.range(0, 41).forEach(index -> {
|
||||
userManagement.register(new Username("user" + index), Password.raw("foobar"));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A Spring Security {@link PasswordEncoder} to encrypt passwords for newly created users, used in
|
||||
* {@link UserManagement}.
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
package example.users;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -86,4 +88,15 @@ public class UserManagement {
|
||||
|
||||
return repository.findByUsername(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a few sample users.
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
|
||||
IntStream.range(0, 41).forEach(index -> {
|
||||
register(new Username("user" + index), Password.raw("foobar"));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user