Browse Source

Update Mockito Usage

Issue gh-13542
pull/13668/head
Josh Cummings 2 years ago
parent
commit
87ae2d41b3
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
  1. 2
      config/src/test/resources/org/springframework/security/config/http/HttpConfigTests-WithObservationRegistry.xml
  2. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CollidingFilters.xml
  3. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomAuthenticationDetailsSourceRef.xml
  4. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomFilters.xml
  5. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomHttpBasicEntryPointRef.xml
  6. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-EntryPoint.xml
  7. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-ExplicitSaveAndExplicitRepository.xml
  8. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-ExpressionHandler.xml
  9. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-HttpFirewall.xml
  10. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-Jaas.xml
  11. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-RequestCache.xml
  12. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-Sec750.xml
  13. 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-SecurityContextRepository.xml
  14. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-AuthenticationManagerResolver.xml
  15. 4
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-AuthenticationManagerResolverPlusOtherConfig.xml
  16. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-ExpiredJwtClockSkew.xml
  17. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-JwtDecoderAndJwkSetUri.xml
  18. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-JwtRestOperations.xml
  19. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockBearerTokenResolver.xml
  20. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockJwtAuthenticationConverter.xml
  21. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockJwtDecoder.xml
  22. 4
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockJwtValidator.xml
  23. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MockOpaqueTokenIntrospector.xml
  24. 5
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenAndAuthenticationConverter.xml
  25. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenAndIntrospectionUri.xml
  26. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenRestOperations.xml
  27. 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-UnexpiredJwtClockSkew.xml
  28. 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithUserDetailsService.xml
  29. 2
      config/src/test/resources/org/springframework/security/config/websocket/WebSocketMessageBrokerConfigTests-CustomAuthorizationManagerConfig.xml

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

@ -29,7 +29,7 @@ @@ -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">

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

@ -29,7 +29,7 @@ @@ -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"/>

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

@ -32,7 +32,7 @@ @@ -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"/>

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

@ -34,7 +34,7 @@ @@ -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"/>

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

@ -30,7 +30,7 @@ @@ -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"/>

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

@ -29,7 +29,7 @@ @@ -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"/>

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

@ -30,7 +30,7 @@ @@ -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"/>

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

@ -35,7 +35,7 @@ @@ -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"/>

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

@ -32,7 +32,7 @@ @@ -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"/>

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

@ -48,7 +48,7 @@ @@ -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">

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

@ -30,7 +30,7 @@ @@ -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"/>

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

@ -38,7 +38,7 @@ @@ -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"/>

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

@ -30,7 +30,7 @@ @@ -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"/>

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

@ -22,7 +22,7 @@ @@ -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>

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

@ -22,10 +22,10 @@ @@ -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>

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

@ -31,7 +31,7 @@ @@ -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
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-JwtDecoderAndJwkSetUri.xml

@ -26,7 +26,7 @@ @@ -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>

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

@ -22,7 +22,7 @@ @@ -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"

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

@ -22,6 +22,6 @@ @@ -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>

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

@ -22,6 +22,6 @@ @@ -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>

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

@ -22,6 +22,6 @@ @@ -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>

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

@ -22,11 +22,11 @@ @@ -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"

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

@ -22,6 +22,6 @@ @@ -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>

5
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenAndAuthenticationConverter.xml

@ -21,9 +21,8 @@ @@ -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>

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

@ -22,7 +22,7 @@ @@ -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>

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

@ -22,7 +22,7 @@ @@ -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"

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

@ -31,7 +31,7 @@ @@ -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
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithUserDetailsService.xml

@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
</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

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

@ -23,7 +23,7 @@ @@ -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"/>

Loading…
Cancel
Save