Replace usage of WebMvcConfigurerAdapter

Closes gh-8964
pull/9497/head
Madhura Bhave 8 years ago
parent ec57c3d92a
commit c2e5fd031a

@ -21,7 +21,7 @@ import org.springframework.boot.actuate.endpoint.EndpointProperties;
import org.springframework.context.EnvironmentAware; import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
* Abstract base class for {@link MvcEndpoint} implementations without a backing * Abstract base class for {@link MvcEndpoint} implementations without a backing
@ -31,8 +31,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
* @author Lari Hotari * @author Lari Hotari
* @since 1.4.0 * @since 1.4.0
*/ */
public abstract class AbstractMvcEndpoint extends WebMvcConfigurerAdapter public abstract class AbstractMvcEndpoint
implements MvcEndpoint, EnvironmentAware { implements MvcEndpoint, WebMvcConfigurer, EnvironmentAware {
private Environment environment; private Environment environment;

@ -39,7 +39,7 @@ import org.springframework.data.neo4j.transaction.Neo4jTransactionManager;
import org.springframework.data.neo4j.web.support.OpenSessionInViewInterceptor; import org.springframework.data.neo4j.web.support.OpenSessionInViewInterceptor;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data Neo4j. * {@link EnableAutoConfiguration Auto-configuration} for Spring Data Neo4j.
@ -108,14 +108,14 @@ public class Neo4jDataAutoConfiguration {
@Configuration @Configuration
@ConditionalOnWebApplication(type = Type.SERVLET) @ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass({ WebMvcConfigurerAdapter.class, @ConditionalOnClass({ WebMvcConfigurer.class,
OpenSessionInViewInterceptor.class }) OpenSessionInViewInterceptor.class })
@ConditionalOnMissingBean(OpenSessionInViewInterceptor.class) @ConditionalOnMissingBean(OpenSessionInViewInterceptor.class)
@ConditionalOnProperty(prefix = "spring.data.neo4j", name = "open-in-view", havingValue = "true", matchIfMissing = true) @ConditionalOnProperty(prefix = "spring.data.neo4j", name = "open-in-view", havingValue = "true", matchIfMissing = true)
protected static class Neo4jWebConfiguration { protected static class Neo4jWebConfiguration {
@Configuration @Configuration
protected static class Neo4jWebMvcConfiguration extends WebMvcConfigurerAdapter { protected static class Neo4jWebMvcConfiguration implements WebMvcConfigurer {
@Bean @Bean
public OpenSessionInViewInterceptor neo4jOpenSessionInViewInterceptor() { public OpenSessionInViewInterceptor neo4jOpenSessionInViewInterceptor() {

@ -26,7 +26,7 @@ import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoCon
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.data.web.config.EnableSpringDataWebSupport; import org.springframework.data.web.config.EnableSpringDataWebSupport;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's web support. * {@link EnableAutoConfiguration Auto-configuration} for Spring Data's web support.
@ -41,7 +41,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@EnableSpringDataWebSupport @EnableSpringDataWebSupport
@ConditionalOnWebApplication(type = Type.SERVLET) @ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass({ PageableHandlerMethodArgumentResolver.class, @ConditionalOnClass({ PageableHandlerMethodArgumentResolver.class,
WebMvcConfigurerAdapter.class }) WebMvcConfigurer.class })
@ConditionalOnMissingBean(PageableHandlerMethodArgumentResolver.class) @ConditionalOnMissingBean(PageableHandlerMethodArgumentResolver.class)
@AutoConfigureAfter(RepositoryRestMvcAutoConfiguration.class) @AutoConfigureAfter(RepositoryRestMvcAutoConfiguration.class)
public class SpringDataWebAutoConfiguration { public class SpringDataWebAutoConfiguration {

@ -33,7 +33,7 @@ import org.springframework.mobile.device.DeviceResolver;
import org.springframework.mobile.device.DeviceResolverHandlerInterceptor; import org.springframework.mobile.device.DeviceResolverHandlerInterceptor;
import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Mobile's * {@link EnableAutoConfiguration Auto-configuration} for Spring Mobile's
@ -62,7 +62,7 @@ public class DeviceResolverAutoConfiguration {
@Configuration @Configuration
@Order(0) @Order(0)
protected static class DeviceResolverMvcConfiguration protected static class DeviceResolverMvcConfiguration
extends WebMvcConfigurerAdapter { implements WebMvcConfigurer {
private DeviceResolverHandlerInterceptor deviceResolverHandlerInterceptor; private DeviceResolverHandlerInterceptor deviceResolverHandlerInterceptor;

@ -33,7 +33,7 @@ import org.springframework.mobile.device.site.SitePreferenceHandlerInterceptor;
import org.springframework.mobile.device.site.SitePreferenceHandlerMethodArgumentResolver; import org.springframework.mobile.device.site.SitePreferenceHandlerMethodArgumentResolver;
import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Mobile's * {@link EnableAutoConfiguration Auto-configuration} for Spring Mobile's
@ -64,7 +64,7 @@ public class SitePreferenceAutoConfiguration {
@Configuration @Configuration
protected static class SitePreferenceMvcConfiguration protected static class SitePreferenceMvcConfiguration
extends WebMvcConfigurerAdapter { implements WebMvcConfigurer {
private final SitePreferenceHandlerInterceptor sitePreferenceHandlerInterceptor; private final SitePreferenceHandlerInterceptor sitePreferenceHandlerInterceptor;

@ -52,7 +52,7 @@ import org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.jta.JtaTransactionManager; import org.springframework.transaction.jta.JtaTransactionManager;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
* Base {@link EnableAutoConfiguration Auto-configuration} for JPA. * Base {@link EnableAutoConfiguration Auto-configuration} for JPA.
@ -197,7 +197,7 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware {
@Configuration @Configuration
@ConditionalOnWebApplication(type = Type.SERVLET) @ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass(WebMvcConfigurerAdapter.class) @ConditionalOnClass(WebMvcConfigurer.class)
@ConditionalOnMissingBean({ OpenEntityManagerInViewInterceptor.class, @ConditionalOnMissingBean({ OpenEntityManagerInViewInterceptor.class,
OpenEntityManagerInViewFilter.class }) OpenEntityManagerInViewFilter.class })
@ConditionalOnProperty(prefix = "spring.jpa", name = "open-in-view", havingValue = "true", matchIfMissing = true) @ConditionalOnProperty(prefix = "spring.jpa", name = "open-in-view", havingValue = "true", matchIfMissing = true)
@ -206,7 +206,7 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware {
// Defined as a nested config to ensure WebMvcConfigurerAdapter is not read when // Defined as a nested config to ensure WebMvcConfigurerAdapter is not read when
// not on the classpath // not on the classpath
@Configuration @Configuration
protected static class JpaWebMvcConfiguration extends WebMvcConfigurerAdapter { protected static class JpaWebMvcConfiguration implements WebMvcConfigurer {
@Bean @Bean
public OpenEntityManagerInViewInterceptor openEntityManagerInViewInterceptor() { public OpenEntityManagerInViewInterceptor openEntityManagerInViewInterceptor() {

@ -30,7 +30,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Security OAuth2. * {@link EnableAutoConfiguration Auto-configuration} for Spring Security OAuth2.
@ -40,7 +40,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
* @since 1.3.0 * @since 1.3.0
*/ */
@Configuration @Configuration
@ConditionalOnClass({ OAuth2AccessToken.class, WebMvcConfigurerAdapter.class }) @ConditionalOnClass({ OAuth2AccessToken.class, WebMvcConfigurer.class })
@Import({ OAuth2AuthorizationServerConfiguration.class, @Import({ OAuth2AuthorizationServerConfiguration.class,
OAuth2MethodSecurityConfiguration.class, OAuth2ResourceServerConfiguration.class, OAuth2MethodSecurityConfiguration.class, OAuth2ResourceServerConfiguration.class,
OAuth2RestOperationsConfiguration.class }) OAuth2RestOperationsConfiguration.class })

@ -114,7 +114,7 @@ import org.springframework.web.servlet.config.annotation.ResourceChainRegistrati
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver; import org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver;
import org.springframework.web.servlet.handler.AbstractUrlHandlerMapping; import org.springframework.web.servlet.handler.AbstractUrlHandlerMapping;
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
@ -146,7 +146,7 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration @Configuration
@ConditionalOnWebApplication(type = Type.SERVLET) @ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass({ Servlet.class, DispatcherServlet.class, @ConditionalOnClass({ Servlet.class, DispatcherServlet.class,
WebMvcConfigurerAdapter.class }) WebMvcConfigurer.class })
@ConditionalOnMissingBean(WebMvcConfigurationSupport.class) @ConditionalOnMissingBean(WebMvcConfigurationSupport.class)
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE + 10) @AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE + 10)
@AutoConfigureAfter({ DispatcherServletAutoConfiguration.class, @AutoConfigureAfter({ DispatcherServletAutoConfiguration.class,
@ -170,15 +170,15 @@ public class WebMvcAutoConfiguration {
return new OrderedHttpPutFormContentFilter(); return new OrderedHttpPutFormContentFilter();
} }
// Defined as a nested config to ensure WebMvcConfigurerAdapter is not read when not // Defined as a nested config to ensure WebMvcConfigurer is not read when not
// on the classpath // on the classpath
@Configuration @Configuration
@Import({ EnableWebMvcConfiguration.class, MvcValidatorRegistrar.class }) @Import({ EnableWebMvcConfiguration.class, MvcValidatorRegistrar.class })
@EnableConfigurationProperties({ WebMvcProperties.class, ResourceProperties.class }) @EnableConfigurationProperties({ WebMvcProperties.class, ResourceProperties.class })
public static class WebMvcAutoConfigurationAdapter extends WebMvcConfigurerAdapter { public static class WebMvcAutoConfigurationAdapter implements WebMvcConfigurer {
private static final Log logger = LogFactory private static final Log logger = LogFactory
.getLog(WebMvcConfigurerAdapter.class); .getLog(WebMvcConfigurer.class);
private final ResourceProperties resourceProperties; private final ResourceProperties resourceProperties;

@ -78,7 +78,7 @@ import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.View; import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.handler.HandlerExceptionResolverComposite; import org.springframework.web.servlet.handler.HandlerExceptionResolverComposite;
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver;
@ -834,7 +834,7 @@ public class WebMvcAutoConfigurationTests {
} }
@Configuration @Configuration
protected static class WebJars extends WebMvcConfigurerAdapter { protected static class WebJars implements WebMvcConfigurer {
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
@ -845,7 +845,7 @@ public class WebMvcAutoConfigurationTests {
} }
@Configuration @Configuration
protected static class AllResources extends WebMvcConfigurerAdapter { protected static class AllResources implements WebMvcConfigurer {
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
@ -976,7 +976,7 @@ public class WebMvcAutoConfigurationTests {
} }
@Configuration @Configuration
protected static class ValidatorWebMvcConfigurer extends WebMvcConfigurerAdapter { protected static class ValidatorWebMvcConfigurer implements WebMvcConfigurer {
@Override @Override
public Validator getValidator() { public Validator getValidator() {

@ -33,7 +33,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@SpringBootConfiguration @SpringBootConfiguration
@EnableAutoConfiguration @EnableAutoConfiguration
@ -60,7 +60,7 @@ public class SampleAtmosphereApplication {
} }
@Configuration @Configuration
static class MvcConfiguration extends WebMvcConfigurerAdapter { static class MvcConfiguration implements WebMvcConfigurer {
@Override @Override
public void addViewControllers(ViewControllerRegistry registry) { public void addViewControllers(ViewControllerRegistry registry) {

@ -23,13 +23,13 @@ import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.view.InternalResourceViewResolver; import org.springframework.web.servlet.view.InternalResourceViewResolver;
@EnableWebMvc @EnableWebMvc
@ComponentScan @ComponentScan
@Configuration @Configuration
public class WebConfig extends WebMvcConfigurerAdapter { public class WebConfig implements WebMvcConfigurer {
@Override @Override
public void addViewControllers(ViewControllerRegistry registry) { public void addViewControllers(ViewControllerRegistry registry) {

@ -35,11 +35,11 @@ import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@SpringBootApplication @SpringBootApplication
@EnableGlobalMethodSecurity(securedEnabled = true) @EnableGlobalMethodSecurity(securedEnabled = true)
public class SampleMethodSecurityApplication extends WebMvcConfigurerAdapter { public class SampleMethodSecurityApplication implements WebMvcConfigurer {
@Controller @Controller
protected static class HomeController { protected static class HomeController {

@ -31,11 +31,11 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@SpringBootApplication @SpringBootApplication
@Controller @Controller
public class SampleWebSecureCustomApplication extends WebMvcConfigurerAdapter { public class SampleWebSecureCustomApplication implements WebMvcConfigurer {
@GetMapping("/") @GetMapping("/")
public String home(Map<String, Object> model) { public String home(Map<String, Object> model) {

@ -19,11 +19,11 @@ package sample.web.secure.github;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso; import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@SpringBootApplication @SpringBootApplication
@EnableOAuth2Sso @EnableOAuth2Sso
public class SampleGithubSecureApplication extends WebMvcConfigurerAdapter { public class SampleGithubSecureApplication implements WebMvcConfigurer {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
SpringApplication.run(SampleGithubSecureApplication.class, args); SpringApplication.run(SampleGithubSecureApplication.class, args);

@ -34,11 +34,11 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@SpringBootApplication @SpringBootApplication
@Controller @Controller
public class SampleWebSecureJdbcApplication extends WebMvcConfigurerAdapter { public class SampleWebSecureJdbcApplication implements WebMvcConfigurer {
@GetMapping("/") @GetMapping("/")
public String home(Map<String, Object> model) { public String home(Map<String, Object> model) {

@ -31,11 +31,11 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@SpringBootApplication @SpringBootApplication
@Controller @Controller
public class SampleWebSecureApplication extends WebMvcConfigurerAdapter { public class SampleWebSecureApplication implements WebMvcConfigurer {
@GetMapping("/") @GetMapping("/")
public String home(Map<String, Object> model) { public String home(Map<String, Object> model) {

@ -30,7 +30,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@ -155,7 +155,7 @@ public class WebMvcTypeExcludeFilterTests {
} }
static class ExampleWeb extends WebMvcConfigurerAdapter { static class ExampleWeb implements WebMvcConfigurer {
} }

@ -26,7 +26,6 @@ import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer; import org.springframework.web.method.support.ModelAndViewContainer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/** /**
* Example {@link WebMvcConfigurer} used in {@link WebMvcTest} tests. * Example {@link WebMvcConfigurer} used in {@link WebMvcTest} tests.
@ -34,7 +33,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
* @author Phillip Webb * @author Phillip Webb
*/ */
@Component @Component
public class ExampleWebMvcConfigurer extends WebMvcConfigurerAdapter { public class ExampleWebMvcConfigurer implements WebMvcConfigurer {
@Override @Override
public void addArgumentResolvers( public void addArgumentResolvers(

@ -52,7 +52,7 @@ import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@ -128,7 +128,7 @@ public class ErrorPageFilterIntegrationTests {
} }
@Controller @Controller
public static class HelloWorldController extends WebMvcConfigurerAdapter { public static class HelloWorldController implements WebMvcConfigurer {
private int status; private int status;

Loading…
Cancel
Save