Update Mockito Usage

Issue gh-13542
This commit is contained in:
Josh Cummings 2023-08-16 16:28:52 -06:00
parent 985e569685
commit 87ae2d41b3
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
29 changed files with 33 additions and 34 deletions

View File

@ -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">

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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">

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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>

View File

@ -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>

View File

@ -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"

View File

@ -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>

View File

@ -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"

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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"

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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"

View File

@ -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"

View File

@ -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>

View File

@ -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"/>