Use explicit types everywhere instead of var
This commit is contained in:
parent
34d964eb08
commit
109da2719f
|
@ -76,8 +76,8 @@ class InitializeAuthenticationProviderBeanManagerConfigurer extends GlobalAuthen
|
|||
+ "using the DSL.", authenticationProviders.size(), beanNames));
|
||||
return;
|
||||
}
|
||||
var authenticationProvider = authenticationProviders.get(0).getBean();
|
||||
var authenticationProviderBeanName = authenticationProviders.get(0).getName();
|
||||
AuthenticationProvider authenticationProvider = authenticationProviders.get(0).getBean();
|
||||
String authenticationProviderBeanName = authenticationProviders.get(0).getName();
|
||||
|
||||
auth.authenticationProvider(authenticationProvider);
|
||||
this.logger.info(LogMessage.format(
|
||||
|
|
|
@ -89,8 +89,8 @@ class InitializeUserDetailsBeanManagerConfigurer extends GlobalAuthenticationCon
|
|||
beanNames));
|
||||
return;
|
||||
}
|
||||
var userDetailsService = userDetailsServices.get(0).getBean();
|
||||
var userDetailsServiceBeanName = userDetailsServices.get(0).getName();
|
||||
UserDetailsService userDetailsService = userDetailsServices.get(0).getBean();
|
||||
String userDetailsServiceBeanName = userDetailsServices.get(0).getName();
|
||||
PasswordEncoder passwordEncoder = getBeanOrNull(PasswordEncoder.class);
|
||||
UserDetailsPasswordService passwordManager = getBeanOrNull(UserDetailsPasswordService.class);
|
||||
CompromisedPasswordChecker passwordChecker = getBeanOrNull(CompromisedPasswordChecker.class);
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.lang.reflect.Modifier;
|
|||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.MockedStatic;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
|
@ -141,7 +142,7 @@ public class AutowireBeanFactoryObjectPostProcessorTests {
|
|||
|
||||
@Test
|
||||
void postProcessWhenObjectIsCgLibProxyAndInNativeImageThenUseExistingBean() {
|
||||
try (var detector = Mockito.mockStatic(NativeDetector.class)) {
|
||||
try (MockedStatic<NativeDetector> detector = Mockito.mockStatic(NativeDetector.class)) {
|
||||
given(NativeDetector.inNativeImage()).willReturn(true);
|
||||
|
||||
ProxyFactory proxyFactory = new ProxyFactory(new MyClass());
|
||||
|
@ -158,7 +159,7 @@ public class AutowireBeanFactoryObjectPostProcessorTests {
|
|||
|
||||
@Test
|
||||
void postProcessWhenObjectIsCgLibProxyAndInNativeImageAndBeanDoesNotExistsThenIllegalStateException() {
|
||||
try (var detector = Mockito.mockStatic(NativeDetector.class)) {
|
||||
try (MockedStatic<NativeDetector> detector = Mockito.mockStatic(NativeDetector.class)) {
|
||||
given(NativeDetector.inNativeImage()).willReturn(true);
|
||||
|
||||
ProxyFactory proxyFactory = new ProxyFactory(new MyClass());
|
||||
|
|
|
@ -267,7 +267,7 @@ public class LdapUserDetailsManagerTests {
|
|||
|
||||
@Test
|
||||
public void testRoleNamesStartWithCustomRolePrefix() {
|
||||
var customPrefix = "GROUP_";
|
||||
String customPrefix = "GROUP_";
|
||||
this.mgr.setRolePrefix(customPrefix);
|
||||
|
||||
this.mgr.setUsernameMapper(new DefaultLdapUsernameToDnMapper("ou=people", "uid"));
|
||||
|
|
Loading…
Reference in New Issue