Apply code cleanup rules to projects

Apply automated cleanup rules to add `@Override` and `@Deprecated`
annotations and to fix class references used with static methods.

Issue gh-8945
This commit is contained in:
Phillip Webb
2020-07-26 12:04:13 -07:00
committed by Rob Winch
parent 8866fa6fb0
commit 9e08b51ed3
558 changed files with 1418 additions and 102 deletions

View File

@@ -179,6 +179,7 @@ public class LdapAuthenticationProviderTests {
class MockAuthenticator implements LdapAuthenticator {
@Override
public DirContextOperations authenticate(Authentication authentication) {
DirContextAdapter ctx = new DirContextAdapter();
ctx.setAttributeValue("ou", "FROM_ENTRY");
@@ -206,6 +207,7 @@ public class LdapAuthenticationProviderTests {
String username;
@Override
public Collection<GrantedAuthority> getGrantedAuthorities(DirContextOperations userCtx, String username) {
this.username = username;
return AuthorityUtils.createAuthorityList("ROLE_FROM_POPULATOR");

View File

@@ -33,6 +33,7 @@ public class MockUserSearch implements LdapUserSearch {
this.user = user;
}
@Override
public DirContextOperations searchForUser(String username) {
return this.user;
}

View File

@@ -290,12 +290,14 @@ public class ActiveDirectoryLdapAuthenticationProviderTests {
private Matcher<String> causeDataCode = CoreMatchers.equalTo(dataCode);
@Override
public boolean matches(Object that) {
Throwable t = (Throwable) that;
ActiveDirectoryAuthenticationException cause = (ActiveDirectoryAuthenticationException) t.getCause();
return this.causeInstance.matches(cause) && this.causeDataCode.matches(cause.getDataCode());
}
@Override
public void describeTo(Description desc) {
desc.appendText("getCause() ");
this.causeInstance.describeTo(desc);
@@ -468,23 +470,28 @@ public class ActiveDirectoryLdapAuthenticationProviderTests {
this.sr = sr;
}
@Override
public SearchResult next() {
SearchResult result = this.sr;
this.sr = null;
return result;
}
@Override
public boolean hasMore() {
return this.sr != null;
}
@Override
public void close() {
}
@Override
public boolean hasMoreElements() {
return hasMore();
}
@Override
public SearchResult nextElement() {
return next();
}

View File

@@ -74,6 +74,7 @@ public class LdapUserDetailsServiceTests {
class MockAuthoritiesPopulator implements LdapAuthoritiesPopulator {
@Override
public Collection<GrantedAuthority> getGrantedAuthorities(DirContextOperations userCtx, String username) {
return AuthorityUtils.createAuthorityList("ROLE_FROM_POPULATOR");
}