Hide utility class constructors
Update all utility classes so that they have a private constructor. This prevents users from accidentally creating an instance, when they should just use the static methods directly. Issue gh-8945
This commit is contained in:
@@ -36,7 +36,10 @@ import org.springframework.security.oauth2.server.resource.introspection.OAuth2I
|
||||
*
|
||||
* @author Josh Cummings
|
||||
*/
|
||||
public class TestOAuth2AuthenticatedPrincipals {
|
||||
public final class TestOAuth2AuthenticatedPrincipals {
|
||||
|
||||
private TestOAuth2AuthenticatedPrincipals() {
|
||||
}
|
||||
|
||||
public static OAuth2AuthenticatedPrincipal active() {
|
||||
return active(attributes -> {
|
||||
|
||||
@@ -33,7 +33,10 @@ import org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal;
|
||||
*
|
||||
* @author Josh Cummings
|
||||
*/
|
||||
public class TestBearerTokenAuthentications {
|
||||
public final class TestBearerTokenAuthentications {
|
||||
|
||||
private TestBearerTokenAuthentications() {
|
||||
}
|
||||
|
||||
public static BearerTokenAuthentication bearer() {
|
||||
Collection<GrantedAuthority> authorities = AuthorityUtils.createAuthorityList("SCOPE_USER");
|
||||
|
||||
Reference in New Issue
Block a user