Reduce method visibility when possible
Reduce method visibility for package private classes when possible. In the case of abstract classes that will eventually be made public, the class has been made public and a package-private constructor has been added. Issue gh-8945
This commit is contained in:
+2
-2
@@ -186,11 +186,11 @@ public class WithSecurityContextTestExecutionListener extends AbstractTestExecut
|
||||
this.testExecutionEvent = testExecutionEvent;
|
||||
}
|
||||
|
||||
public Supplier<SecurityContext> getSecurityContextSupplier() {
|
||||
Supplier<SecurityContext> getSecurityContextSupplier() {
|
||||
return this.securityContextSupplier;
|
||||
}
|
||||
|
||||
public TestExecutionEvent getTestExecutionEvent() {
|
||||
TestExecutionEvent getTestExecutionEvent() {
|
||||
return this.testExecutionEvent;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ final class WithUserDetailsSecurityContextFactory implements WithSecurityContext
|
||||
: this.beans.getBean(UserDetailsService.class);
|
||||
}
|
||||
|
||||
public UserDetailsService findAndAdaptReactiveUserDetailsService(String beanName) {
|
||||
UserDetailsService findAndAdaptReactiveUserDetailsService(String beanName) {
|
||||
try {
|
||||
ReactiveUserDetailsService reactiveUserDetailsService = StringUtils.hasLength(beanName)
|
||||
? this.beans.getBean(beanName, ReactiveUserDetailsService.class)
|
||||
|
||||
+4
-5
@@ -1178,11 +1178,11 @@ public final class SecurityMockServerConfigurers {
|
||||
}
|
||||
}
|
||||
|
||||
public static void enable(ServerWebExchange exchange) {
|
||||
static void enable(ServerWebExchange exchange) {
|
||||
exchange.getAttributes().put(ENABLED_ATTR_NAME, Boolean.TRUE);
|
||||
}
|
||||
|
||||
public boolean isEnabled(ServerWebExchange exchange) {
|
||||
boolean isEnabled(ServerWebExchange exchange) {
|
||||
return Boolean.TRUE.equals(exchange.getAttribute(ENABLED_ATTR_NAME));
|
||||
}
|
||||
|
||||
@@ -1204,8 +1204,7 @@ public final class SecurityMockServerConfigurers {
|
||||
* @return the {@link ReactiveOAuth2AuthorizedClientManager} for the specified
|
||||
* {@link ServerWebExchange}
|
||||
*/
|
||||
public static ReactiveOAuth2AuthorizedClientManager getOAuth2AuthorizedClientManager(
|
||||
ServerWebExchange exchange) {
|
||||
static ReactiveOAuth2AuthorizedClientManager getOAuth2AuthorizedClientManager(ServerWebExchange exchange) {
|
||||
OAuth2AuthorizedClientArgumentResolver resolver = findResolver(exchange,
|
||||
OAuth2AuthorizedClientArgumentResolver.class);
|
||||
if (resolver == null) {
|
||||
@@ -1223,7 +1222,7 @@ public final class SecurityMockServerConfigurers {
|
||||
* {@link ReactiveOAuth2AuthorizedClientManager}
|
||||
* @param manager the {@link ReactiveOAuth2AuthorizedClientManager} to set
|
||||
*/
|
||||
public static void setOAuth2AuthorizedClientManager(ServerWebExchange exchange,
|
||||
static void setOAuth2AuthorizedClientManager(ServerWebExchange exchange,
|
||||
ReactiveOAuth2AuthorizedClientManager manager) {
|
||||
OAuth2AuthorizedClientArgumentResolver resolver = findResolver(exchange,
|
||||
OAuth2AuthorizedClientArgumentResolver.class);
|
||||
|
||||
+9
-9
@@ -568,11 +568,11 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
}
|
||||
}
|
||||
|
||||
public static void enable(HttpServletRequest request) {
|
||||
static void enable(HttpServletRequest request) {
|
||||
request.setAttribute(ENABLED_ATTR_NAME, Boolean.TRUE);
|
||||
}
|
||||
|
||||
public boolean isEnabled(HttpServletRequest request) {
|
||||
boolean isEnabled(HttpServletRequest request) {
|
||||
return Boolean.TRUE.equals(request.getAttribute(ENABLED_ATTR_NAME));
|
||||
}
|
||||
|
||||
@@ -1659,11 +1659,11 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
}
|
||||
}
|
||||
|
||||
public static void enable(HttpServletRequest request) {
|
||||
static void enable(HttpServletRequest request) {
|
||||
request.setAttribute(ENABLED_ATTR_NAME, Boolean.TRUE);
|
||||
}
|
||||
|
||||
public boolean isEnabled(HttpServletRequest request) {
|
||||
boolean isEnabled(HttpServletRequest request) {
|
||||
return Boolean.TRUE.equals(request.getAttribute(ENABLED_ATTR_NAME));
|
||||
}
|
||||
|
||||
@@ -1673,6 +1673,9 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
|
||||
private static final OAuth2AuthorizedClientRepository DEFAULT_CLIENT_REPO = new HttpSessionOAuth2AuthorizedClientRepository();
|
||||
|
||||
private OAuth2ClientServletTestUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link OAuth2AuthorizedClientManager} for the specified
|
||||
* {@link HttpServletRequest}. If one is not found, one based off of
|
||||
@@ -1682,7 +1685,7 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
* @return the {@link OAuth2AuthorizedClientManager} for the specified
|
||||
* {@link HttpServletRequest}
|
||||
*/
|
||||
public static OAuth2AuthorizedClientManager getOAuth2AuthorizedClientManager(HttpServletRequest request) {
|
||||
static OAuth2AuthorizedClientManager getOAuth2AuthorizedClientManager(HttpServletRequest request) {
|
||||
OAuth2AuthorizedClientArgumentResolver resolver = findResolver(request,
|
||||
OAuth2AuthorizedClientArgumentResolver.class);
|
||||
if (resolver == null) {
|
||||
@@ -1700,7 +1703,7 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
* {@link OAuth2AuthorizedClientManager}
|
||||
* @param manager the {@link OAuth2AuthorizedClientManager} to set
|
||||
*/
|
||||
public static void setOAuth2AuthorizedClientManager(HttpServletRequest request,
|
||||
static void setOAuth2AuthorizedClientManager(HttpServletRequest request,
|
||||
OAuth2AuthorizedClientManager manager) {
|
||||
OAuth2AuthorizedClientArgumentResolver resolver = findResolver(request,
|
||||
OAuth2AuthorizedClientArgumentResolver.class);
|
||||
@@ -1755,9 +1758,6 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
|
||||
}
|
||||
|
||||
private OAuth2ClientServletTestUtils() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user