Browse Source

Update Mockito Usage

Issue gh-13542
Josh Cummings 2 years ago
parent
commit
87ae2d41b3
29 changed files with 33 additions and 34 deletions
  1. 1 1
      config/src/test/resources/org/springframework/security/config/http/HttpConfigTests-WithObservationRegistry.xml
  2. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CollidingFilters.xml
  3. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomAuthenticationDetailsSourceRef.xml
  4. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomFilters.xml
  5. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomHttpBasicEntryPointRef.xml
  6. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-EntryPoint.xml
  7. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-ExplicitSaveAndExplicitRepository.xml
  8. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-ExpressionHandler.xml
  9. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-HttpFirewall.xml
  10. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-Jaas.xml
  11. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-RequestCache.xml
  12. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-Sec750.xml
  13. 1 1
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-SecurityContextRepository.xml
  14. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-AuthenticationManagerResolver.xml
  15. 2 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-AuthenticationManagerResolverPlusOtherConfig.xml
  16. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-ExpiredJwtClockSkew.xml
  17. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-JwtDecoderAndJwkSetUri.xml
  18. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-JwtRestOperations.xml
  19. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockBearerTokenResolver.xml
  20. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockJwtAuthenticationConverter.xml
  21. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockJwtDecoder.xml
  22. 2 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockJwtValidator.xml
  23. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockOpaqueTokenIntrospector.xml
  24. 2 3
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenAndAuthenticationConverter.xml
  25. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenAndIntrospectionUri.xml
  26. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenRestOperations.xml
  27. 1 1
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-UnexpiredJwtClockSkew.xml
  28. 2 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithUserDetailsService.xml
  29. 1 1
      config/src/test/resources/org/springframework/security/config/websocket/WebSocketMessageBrokerConfigTests-CustomAuthorizationManagerConfig.xml

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/HttpConfigTests-WithObservationRegistry.xml

@@ -29,7 +29,7 @@
 	</http>
 
 	<b:bean name="handler" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="io.micrometer.observation.ObservationHandler"/>
+		<b:constructor-arg value="io.micrometer.observation.ObservationHandler" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:bean name="ref" class="org.springframework.security.config.http.HttpConfigTests.MockObservationRegistry">

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CollidingFilters.xml

@@ -29,7 +29,7 @@
 	</http>
 
 	<b:bean name="userFilter" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="jakarta.servlet.Filter"/>
+		<b:constructor-arg value="jakarta.servlet.Filter" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:import resource="userservice.xml"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomAuthenticationDetailsSourceRef.xml

@@ -32,7 +32,7 @@
 	</http>
 
 	<b:bean name="authenticationDetailsSource" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.authentication.AuthenticationDetailsSource"/>
+		<b:constructor-arg value="org.springframework.security.authentication.AuthenticationDetailsSource" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:import resource="MiscHttpConfigTests-controllers.xml"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomFilters.xml

@@ -34,7 +34,7 @@
 	<b:bean name="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
 	<b:bean name="userFilter" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="jakarta.servlet.Filter"/>
+		<b:constructor-arg value="jakarta.servlet.Filter" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:import resource="userservice.xml"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomHttpBasicEntryPointRef.xml

@@ -30,7 +30,7 @@
 	</http>
 
 	<b:bean name="entryPoint" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.web.AuthenticationEntryPoint"/>
+		<b:constructor-arg value="org.springframework.security.web.AuthenticationEntryPoint" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:import resource="userservice.xml"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-EntryPoint.xml

@@ -29,7 +29,7 @@
 	</http>
 
 	<b:bean name="entryPoint" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.web.AuthenticationEntryPoint"/>
+		<b:constructor-arg value="org.springframework.security.web.AuthenticationEntryPoint" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:import resource="userservice.xml"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-ExplicitSaveAndExplicitRepository.xml

@@ -30,7 +30,7 @@
 	</http>
 
 	<b:bean name="repo" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.web.context.SecurityContextRepository"/>
+		<b:constructor-arg value="org.springframework.security.web.context.SecurityContextRepository" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:import resource="MiscHttpConfigTests-controllers.xml"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-ExpressionHandler.xml

@@ -35,7 +35,7 @@
 	</b:bean>
 
 	<b:bean name="permissionEvaluator" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.access.PermissionEvaluator"/>
+		<b:constructor-arg value="org.springframework.security.access.PermissionEvaluator" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:import resource="userservice.xml"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-HttpFirewall.xml

@@ -32,7 +32,7 @@
 	</http>
 
 	<b:bean name="firewall" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.web.firewall.HttpFirewall"/>
+		<b:constructor-arg value="org.springframework.security.web.firewall.HttpFirewall" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:import resource="userservice.xml"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-Jaas.xml

@@ -48,7 +48,7 @@
 	</b:bean>
 
 	<b:bean name="jaasAuthorityGranter" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.authentication.jaas.AuthorityGranter"/>
+		<b:constructor-arg value="org.springframework.security.authentication.jaas.AuthorityGranter" type="java.lang.Class"/>
 	</b:bean>
 
 	<authentication-manager id="authenticationManager">

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-RequestCache.xml

@@ -30,7 +30,7 @@
 	</http>
 
 	<b:bean name="requestCache" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.web.savedrequest.RequestCache"/>
+		<b:constructor-arg value="org.springframework.security.web.savedrequest.RequestCache" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:import resource="userservice.xml"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-Sec750.xml

@@ -38,7 +38,7 @@
 	</b:bean>
 
 	<b:bean name="userService" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.core.userdetails.UserDetailsService"/>
+		<b:constructor-arg value="org.springframework.security.core.userdetails.UserDetailsService" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:bean name="beanNameCollectingPostProcessor" class="org.springframework.security.BeanNameCollectingPostProcessor"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-SecurityContextRepository.xml

@@ -30,7 +30,7 @@
 	</http>
 
 	<b:bean name="repo" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.web.context.SecurityContextRepository"/>
+		<b:constructor-arg value="org.springframework.security.web.context.SecurityContextRepository" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:import resource="MiscHttpConfigTests-controllers.xml"/>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-AuthenticationManagerResolver.xml

@@ -22,7 +22,7 @@
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
 	<b:bean name="authenticationManagerResolver" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.authentication.AuthenticationManagerResolver"/>
+		<b:constructor-arg value="org.springframework.security.authentication.AuthenticationManagerResolver" type="java.lang.Class"/>
 	</b:bean>
 
 	<http>

+ 2 - 2
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-AuthenticationManagerResolverPlusOtherConfig.xml

@@ -22,10 +22,10 @@
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
 	<b:bean name="authenticationManagerResolver" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.authentication.AuthenticationManagerResolver"/>
+		<b:constructor-arg value="org.springframework.security.authentication.AuthenticationManagerResolver" type="java.lang.Class"/>
 	</b:bean>
 	<b:bean name="decoder" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.oauth2.jwt.JwtDecoder"/>
+		<b:constructor-arg value="org.springframework.security.oauth2.jwt.JwtDecoder" type="java.lang.Class"/>
 	</b:bean>
 
 	<http>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-ExpiredJwtClockSkew.xml

@@ -31,7 +31,7 @@
 	</b:bean>
 
 	<b:bean name="rest" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.web.client.RestOperations"/>
+		<b:constructor-arg value="org.springframework.web.client.RestOperations" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:bean name="decoder"

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-JwtDecoderAndJwkSetUri.xml

@@ -26,7 +26,7 @@
 	<c:component-scan base-package="org.springframework.security.config.http"/>
 	<c:property-placeholder local-override="true"/>
 	<b:bean name="decoder" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.oauth2.jwt.JwtDecoder"/>
+		<b:constructor-arg value="org.springframework.security.oauth2.jwt.JwtDecoder" type="java.lang.Class"/>
 	</b:bean>
 
 	<http>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-JwtRestOperations.xml

@@ -22,7 +22,7 @@
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
 	<b:bean name="rest" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.web.client.RestOperations"/>
+		<b:constructor-arg value="org.springframework.web.client.RestOperations" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:bean name="decoder"

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockBearerTokenResolver.xml

@@ -22,6 +22,6 @@
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
 	<b:bean name="bearerTokenResolver" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.oauth2.server.resource.web.BearerTokenResolver"/>
+		<b:constructor-arg value="org.springframework.security.oauth2.server.resource.web.BearerTokenResolver" type="java.lang.Class"/>
 	</b:bean>
 </b:beans>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockJwtAuthenticationConverter.xml

@@ -22,6 +22,6 @@
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
 	<b:bean name="jwtAuthenticationConverter" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.core.convert.converter.Converter"/>
+		<b:constructor-arg value="org.springframework.core.convert.converter.Converter" type="java.lang.Class"/>
 	</b:bean>
 </b:beans>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockJwtDecoder.xml

@@ -22,6 +22,6 @@
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
 	<b:bean name="decoder" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.oauth2.jwt.JwtDecoder"/>
+		<b:constructor-arg value="org.springframework.security.oauth2.jwt.JwtDecoder" type="java.lang.Class"/>
 	</b:bean>
 </b:beans>

+ 2 - 2
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockJwtValidator.xml

@@ -22,11 +22,11 @@
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
 	<b:bean name="jwtValidator" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.oauth2.core.OAuth2TokenValidator"/>
+		<b:constructor-arg value="org.springframework.security.oauth2.core.OAuth2TokenValidator" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:bean name="rest" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.web.client.RestOperations"/>
+		<b:constructor-arg value="org.springframework.web.client.RestOperations" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:bean name="decoder"

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockOpaqueTokenIntrospector.xml

@@ -22,6 +22,6 @@
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
 	<b:bean name="introspector" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenIntrospector"/>
+		<b:constructor-arg value="org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenIntrospector" type="java.lang.Class"/>
 	</b:bean>
 </b:beans>

+ 2 - 3
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenAndAuthenticationConverter.xml

@@ -21,9 +21,8 @@
 		 xsi:schemaLocation="http://www.springframework.org/schema/security https://www.springframework.org/schema/security/spring-security.xsd
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
-	<b:bean name="authentication-converter"
-			class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenAuthenticationConverter"/>
+	<b:bean name="authentication-converter" class="org.mockito.Mockito" factory-method="mock">
+		<b:constructor-arg value="org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenAuthenticationConverter" type="java.lang.Class"/>
 	</b:bean>
 
 	<http>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenAndIntrospectionUri.xml

@@ -22,7 +22,7 @@
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
 	<b:bean name="introspector" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenIntrospector"/>
+		<b:constructor-arg value="org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenIntrospector" type="java.lang.Class"/>
 	</b:bean>
 
 	<http>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenRestOperations.xml

@@ -22,7 +22,7 @@
 		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
 
 	<b:bean name="rest" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.web.client.RestOperations"/>
+		<b:constructor-arg value="org.springframework.web.client.RestOperations" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:bean name="introspector"

+ 1 - 1
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-UnexpiredJwtClockSkew.xml

@@ -31,7 +31,7 @@
 	</b:bean>
 
 	<b:bean name="rest" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.web.client.RestOperations"/>
+		<b:constructor-arg value="org.springframework.web.client.RestOperations" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:bean name="decoder"

+ 2 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithUserDetailsService.xml

@@ -34,12 +34,12 @@
 	</authentication-manager>
 
 	<b:bean name="userDetailsService" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.core.userdetails.UserDetailsService"/>
+		<b:constructor-arg value="org.springframework.security.core.userdetails.UserDetailsService" type="java.lang.Class"/>
 	</b:bean>
 
 	<b:bean
 		name="basicController"
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
-	
+
 	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>

+ 1 - 1
config/src/test/resources/org/springframework/security/config/websocket/WebSocketMessageBrokerConfigTests-CustomAuthorizationManagerConfig.xml

@@ -23,7 +23,7 @@
 	<b:import resource="classpath:org/springframework/security/config/websocket/websocket.xml"/>
 
 	<b:bean name="authorizationManager" class="org.mockito.Mockito" factory-method="mock">
-		<b:constructor-arg value="org.springframework.security.authorization.AuthorizationManager"/>
+		<b:constructor-arg value="org.springframework.security.authorization.AuthorizationManager" type="java.lang.Class"/>
 	</b:bean>
 
 	<websocket-message-broker authorization-manager-ref="authorizationManager"/>