Add SpringTestContextExtension to existing ExtendWith

rg 'import org.springframework.security.config.test.SpringTestContext' -l -g "*.java" | xargs rg '@ExtendWith' -l | xargs sed -E -i 's/@ExtendWith\((.*)\)/@ExtendWith({ \1, SpringTestContextExtension.class })/'
This commit is contained in:
Rob Winch 2021-07-09 10:24:17 -05:00
parent 5133340bf8
commit e4b09f62f0
23 changed files with 23 additions and 23 deletions

View File

@ -73,7 +73,7 @@ import static org.mockito.Mockito.verify;
* @author Rob Winch
* @author Artsiom Yudovin
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class GlobalMethodSecurityConfigurationTests {

View File

@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
* @author Rob Winch
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class NamespaceGlobalMethodSecurityExpressionHandlerTests {

View File

@ -63,7 +63,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
* @author Rob Winch
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class NamespaceGlobalMethodSecurityTests {

View File

@ -65,7 +65,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
* @author Evgeniy Cheban
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class PrePostMethodSecurityConfigurationTests {

View File

@ -51,7 +51,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Josh Cummings
*
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class Sec2758Tests {

View File

@ -55,7 +55,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
* @author Rob Winch
*
*/
@ExtendWith(MockitoExtension.class)
@ExtendWith({ MockitoExtension.class, SpringTestContextExtension.class })
public class WebSecurityConfigurerAdapterMockitoTests {
ConfigurableWebApplicationContext context;

View File

@ -41,7 +41,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
/**
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class ExceptionHandlingConfigurerAccessDeniedHandlerTests {

View File

@ -47,7 +47,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Rafiullah Hamedy
*
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class LogoutConfigurerClearSiteDataTests {

View File

@ -53,7 +53,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Josh Cummings
*
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class NamespaceHttpExpressionHandlerTests {

View File

@ -56,7 +56,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Rob Winch
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class NamespaceHttpLogoutTests {

View File

@ -47,7 +47,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Josh Cummings
*
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class UrlAuthorizationsTests {

View File

@ -77,7 +77,7 @@ import static org.springframework.security.test.web.reactive.server.SecurityMock
* @author Rob Winch
* @since 5.0
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class EnableWebFluxSecurityTests {

View File

@ -45,7 +45,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Luke Taylor
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class AccessDeniedConfigTests {

View File

@ -77,7 +77,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Rob Winch
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class CsrfConfigTests {

View File

@ -67,7 +67,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*
* @author Joe Grandja
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class OAuth2ClientBeanDefinitionParserTests {

View File

@ -90,7 +90,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*
* @author Ruby Hartono
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class OAuth2LoginBeanDefinitionParserTests {

View File

@ -119,7 +119,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
/**
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class OAuth2ResourceServerBeanDefinitionParserTests {

View File

@ -38,7 +38,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
/**
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class PlaceHolderAndELConfigTests {

View File

@ -52,7 +52,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Rob Winch
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class SecurityContextHolderAwareRequestConfigTests {

View File

@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
/**
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class MethodSecurityBeanDefinitionParserTests {

View File

@ -69,7 +69,7 @@ import static org.mockito.Mockito.verify;
* @author Parikshit Dutta
* @since 5.1
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class OAuth2ClientSpecTests {

View File

@ -93,7 +93,7 @@ import static org.mockito.Mockito.verify;
* Tests for
* {@link org.springframework.security.config.web.server.ServerHttpSecurity.OAuth2ResourceServerSpec}
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
public class OAuth2ResourceServerSpecTests {
private String expired = "eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE1MzUwMzc4OTd9.jqZDDjfc2eysX44lHXEIr9XFd2S8vjIZHCccZU-dRWMRJNsQ1QN5VNnJGklqJBXJR4qgla6cmVqPOLkUHDb0sL0nxM5XuzQaG5ZzKP81RV88shFyAiT0fD-6nl1k-Fai-Fu-VkzSpNXgeONoTxDaYhdB-yxmgrgsApgmbOTE_9AcMk-FQDXQ-pL9kynccFGV0lZx4CA7cyknKN7KBxUilfIycvXODwgKCjj_1WddLTCNGYogJJSg__7NoxzqbyWd3udbHVjqYq7GsMMrGB4_2kBD4CkghOSNcRHbT_DIXowxfAVT7PAg7Q0E5ruZsr2zPZacEUDhJ6-wbvlA0FAOUg";

View File

@ -74,7 +74,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
* @author Rob Winch
* @author Josh Cummings
*/
@ExtendWith(SpringExtension.class)
@ExtendWith({ SpringExtension.class, SpringTestContextExtension.class })
@SecurityTestExecutionListeners
public class WebSocketMessageBrokerConfigTests {