mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-30 16:52:13 +00:00
Polish
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
parent
c9bbf3787b
commit
88369cd252
@ -605,6 +605,7 @@ public class JdbcUserDetailsManager extends JdbcDaoImpl
|
||||
* set this to {@code true} to enable password updates.
|
||||
* @param enableUpdatePassword {@code true} to enable password updates, {@code false}
|
||||
* otherwise.
|
||||
* @since 7.0
|
||||
*/
|
||||
public void setEnableUpdatePassword(boolean enableUpdatePassword) {
|
||||
this.enableUpdatePassword = enableUpdatePassword;
|
||||
@ -626,6 +627,7 @@ public class JdbcUserDetailsManager extends JdbcDaoImpl
|
||||
/**
|
||||
* Conditionally updates password based on the setting from
|
||||
* {@link #setEnableUpdatePassword(boolean)}. {@inheritDoc}
|
||||
* @since 7.0
|
||||
*/
|
||||
@Override
|
||||
public UserDetails updatePassword(UserDetails user, String newPassword) {
|
||||
|
@ -285,10 +285,9 @@ public class JdbcUserDetailsManagerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void createGroupInsertsCorrectData() {
|
||||
this.manager.createGroup("TEST_GROUP", AuthorityUtils.createAuthorityList("ROLE_X", "ROLE_Y"));
|
||||
List roles = this.template.queryForList("select ga.authority from groups g, group_authorities ga "
|
||||
List<?> roles = this.template.queryForList("select ga.authority from groups g, group_authorities ga "
|
||||
+ "where ga.group_id = g.id " + "and g.group_name = 'TEST_GROUP'");
|
||||
assertThat(roles).hasSize(2);
|
||||
}
|
||||
@ -367,7 +366,7 @@ public class JdbcUserDetailsManagerTests {
|
||||
|
||||
// SEC-2166
|
||||
@Test
|
||||
public void createNewAuthenticationUsesNullPasswordToKeepPassordsSave() {
|
||||
public void createNewAuthenticationUsesNullPasswordToKeepPasswordSave() {
|
||||
insertJoe();
|
||||
UsernamePasswordAuthenticationToken currentAuth = UsernamePasswordAuthenticationToken.authenticated("joe", null,
|
||||
AuthorityUtils.createAuthorityList("ROLE_USER"));
|
||||
@ -443,9 +442,9 @@ public class JdbcUserDetailsManagerTests {
|
||||
this.cache.putUserInCache(joe);
|
||||
}
|
||||
|
||||
private class MockUserCache implements UserCache {
|
||||
private static class MockUserCache implements UserCache {
|
||||
|
||||
private Map<String, UserDetails> cache = new HashMap<>();
|
||||
private final Map<String, UserDetails> cache = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public UserDetails getUserFromCache(String username) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user