Deprecate adapter classes for async interceptors

This commit is contained in:
Rossen Stoyanchev
2017-06-26 15:34:51 -04:00
parent eb0479dee8
commit 5b8f7f503f
18 changed files with 91 additions and 76 deletions

View File

@@ -84,9 +84,7 @@ import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.context.request.async.CallableProcessingInterceptor;
import org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter;
import org.springframework.web.context.request.async.DeferredResultProcessingInterceptor;
import org.springframework.web.context.request.async.DeferredResultProcessingInterceptorAdapter;
import org.springframework.web.context.support.GenericWebApplicationContext;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.method.HandlerMethod;
@@ -143,8 +141,16 @@ import org.springframework.web.servlet.view.tiles3.TilesConfigurer;
import org.springframework.web.servlet.view.tiles3.TilesViewResolver;
import org.springframework.web.util.UrlPathHelper;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
/**
* Tests loading actual MVC namespace configuration.
@@ -1029,11 +1035,11 @@ public class MvcNamespaceTests {
}
public static class TestCallableProcessingInterceptor extends CallableProcessingInterceptorAdapter {
public static class TestCallableProcessingInterceptor implements CallableProcessingInterceptor {
}
public static class TestDeferredResultProcessingInterceptor extends DeferredResultProcessingInterceptorAdapter {
public static class TestDeferredResultProcessingInterceptor implements DeferredResultProcessingInterceptor {
}

View File

@@ -22,7 +22,6 @@ import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Before;
import org.junit.Test;
@@ -54,9 +53,7 @@ import org.springframework.web.bind.support.ConfigurableWebBindingInitializer;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.context.request.async.CallableProcessingInterceptor;
import org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter;
import org.springframework.web.context.request.async.DeferredResultProcessingInterceptor;
import org.springframework.web.context.request.async.DeferredResultProcessingInterceptorAdapter;
import org.springframework.web.context.support.StaticWebApplicationContext;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.method.annotation.ModelAttributeMethodProcessor;
@@ -373,8 +370,8 @@ public class WebMvcConfigurationSupportExtensionTests {
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
configurer.setDefaultTimeout(2500).setTaskExecutor(new ConcurrentTaskExecutor())
.registerCallableInterceptors(new CallableProcessingInterceptorAdapter() { })
.registerDeferredResultInterceptors(new DeferredResultProcessingInterceptorAdapter() {});
.registerCallableInterceptors(new CallableProcessingInterceptor() { })
.registerDeferredResultInterceptors(new DeferredResultProcessingInterceptor() {});
}
@Override