Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
73999567
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
73999567
编写于
2月 02, 2017
作者:
R
Rossen Stoyanchev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename classes and methods containing "WebReactive"
Issue: SPR-15190
上级
123ee5f2
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
125 addition
and
125 deletion
+125
-125
spring-webflux/src/main/java/org/springframework/web/reactive/config/DelegatingWebFluxConfiguration.java
...k/web/reactive/config/DelegatingWebFluxConfiguration.java
+8
-8
spring-webflux/src/main/java/org/springframework/web/reactive/config/EnableWebFlux.java
...rg/springframework/web/reactive/config/EnableWebFlux.java
+16
-16
spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java
...work/web/reactive/config/WebFluxConfigurationSupport.java
+16
-16
spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurer.java
...pringframework/web/reactive/config/WebFluxConfigurer.java
+5
-5
spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurerComposite.java
...ework/web/reactive/config/WebFluxConfigurerComposite.java
+8
-8
spring-webflux/src/main/java/org/springframework/web/reactive/resource/AppCacheManifestTransformer.java
...rk/web/reactive/resource/AppCacheManifestTransformer.java
+1
-1
spring-webflux/src/test/java/org/springframework/web/reactive/config/DelegatingWebFluxConfigurationTests.java
.../reactive/config/DelegatingWebFluxConfigurationTests.java
+28
-28
spring-webflux/src/test/java/org/springframework/web/reactive/config/WebFluxConfigurationSupportTests.java
...web/reactive/config/WebFluxConfigurationSupportTests.java
+17
-17
spring-webflux/src/test/java/org/springframework/web/reactive/function/server/DispatcherHandlerIntegrationTests.java
...ve/function/server/DispatcherHandlerIntegrationTests.java
+2
-2
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/BindingContextFactoryTests.java
.../result/method/annotation/BindingContextFactoryTests.java
+2
-2
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ContextPathIntegrationTests.java
...result/method/annotation/ContextPathIntegrationTests.java
+3
-3
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/CrossOriginAnnotationIntegrationTests.java
...hod/annotation/CrossOriginAnnotationIntegrationTests.java
+2
-2
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/GlobalCorsConfigIntegrationTests.java
...t/method/annotation/GlobalCorsConfigIntegrationTests.java
+2
-2
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/JacksonHintsIntegrationTests.java
...esult/method/annotation/JacksonHintsIntegrationTests.java
+2
-2
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingDataBindingIntegrationTests.java
...annotation/RequestMappingDataBindingIntegrationTests.java
+2
-2
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingExceptionHandlingIntegrationTests.java
...tion/RequestMappingExceptionHandlingIntegrationTests.java
+2
-2
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingIntegrationTests.java
...ult/method/annotation/RequestMappingIntegrationTests.java
+2
-2
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingMessageConversionIntegrationTests.java
...tion/RequestMappingMessageConversionIntegrationTests.java
+2
-2
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingViewResolutionIntegrationTests.java
...otation/RequestMappingViewResolutionIntegrationTests.java
+2
-2
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/SseIntegrationTests.java
...eactive/result/method/annotation/SseIntegrationTests.java
+2
-2
src/asciidoc/web-flux.adoc
src/asciidoc/web-flux.adoc
+1
-1
未找到文件。
spring-webflux/src/main/java/org/springframework/web/reactive/config/DelegatingWeb
Reactive
Configuration.java
→
spring-webflux/src/main/java/org/springframework/web/reactive/config/DelegatingWeb
Flux
Configuration.java
浏览文件 @
73999567
...
...
@@ -30,23 +30,23 @@ import org.springframework.web.reactive.accept.RequestedContentTypeResolverBuild
import
org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver
;
/**
* A subclass of {@code Web
Reactive
ConfigurationSupport} that detects and delegates
* to all beans of type {@link Web
Reactive
Configurer} allowing them to customize the
* configuration provided by {@code Web
Reactive
ConfigurationSupport}. This is the
* class actually imported by {@link EnableWeb
Reactive @EnableWebReactive
}.
* A subclass of {@code Web
Flux
ConfigurationSupport} that detects and delegates
* to all beans of type {@link Web
Flux
Configurer} allowing them to customize the
* configuration provided by {@code Web
Flux
ConfigurationSupport}. This is the
* class actually imported by {@link EnableWeb
Flux @EnableWebFlux
}.
*
* @author Brian Clozel
* @since 5.0
*/
@Configuration
public
class
DelegatingWeb
ReactiveConfiguration
extends
WebReactive
ConfigurationSupport
{
public
class
DelegatingWeb
FluxConfiguration
extends
WebFlux
ConfigurationSupport
{
private
final
Web
ReactiveConfigurerComposite
configurers
=
new
WebReactive
ConfigurerComposite
();
private
final
Web
FluxConfigurerComposite
configurers
=
new
WebFlux
ConfigurerComposite
();
@Autowired
(
required
=
false
)
public
void
setConfigurers
(
List
<
Web
Reactive
Configurer
>
configurers
)
{
public
void
setConfigurers
(
List
<
Web
Flux
Configurer
>
configurers
)
{
if
(!
CollectionUtils
.
isEmpty
(
configurers
))
{
this
.
configurers
.
addWeb
Reactive
Configurers
(
configurers
);
this
.
configurers
.
addWeb
Flux
Configurers
(
configurers
);
}
}
...
...
spring-webflux/src/main/java/org/springframework/web/reactive/config/EnableWeb
Reactive
.java
→
spring-webflux/src/main/java/org/springframework/web/reactive/config/EnableWeb
Flux
.java
浏览文件 @
73999567
...
...
@@ -26,11 +26,11 @@ import org.springframework.context.annotation.Import;
/**
* Adding this annotation to an {@code @Configuration} class imports the Spring Web
* Reactive configuration from {@link Web
Reactive
ConfigurationSupport}, e.g.:
* Reactive configuration from {@link Web
Flux
ConfigurationSupport}, e.g.:
*
* <pre class="code">
* @Configuration
* @EnableWeb
Reactive
* @EnableWeb
Flux
* @ComponentScan(basePackageClasses = MyConfiguration.class)
* public class MyConfiguration {
*
...
...
@@ -38,13 +38,13 @@ import org.springframework.context.annotation.Import;
* </pre>
*
* <p>To customize the imported configuration implement
* {@link Web
Reactive
Configurer} and override individual methods as shown below:
* {@link Web
Flux
Configurer} and override individual methods as shown below:
*
* <pre class="code">
* @Configuration
* @EnableWeb
Reactive
* @EnableWeb
Flux
* @ComponentScan(basePackageClasses = MyConfiguration.class)
* public class MyConfiguration implements Web
Reactive
Configurer {
* public class MyConfiguration implements Web
Flux
Configurer {
*
* @Override
* public void addFormatters(FormatterRegistry formatterRegistry) {
...
...
@@ -60,26 +60,26 @@ import org.springframework.context.annotation.Import;
* </pre>
*
* <p><strong>Note:</strong> only one {@code @Configuration} class may have the
* {@code @EnableWeb
Reactive
} annotation to import the Spring Web Reactive
* {@code @EnableWeb
Flux
} annotation to import the Spring Web Reactive
* configuration. There can however be multiple {@code @Configuration} classes
* implementing {@code Web
Reactive
Configurer} in order to customize the provided
* implementing {@code Web
Flux
Configurer} in order to customize the provided
* configuration.
*
* <p>If {@link Web
Reactive
Configurer} does not expose some more advanced setting
* that needs to be configured consider removing the {@code @EnableWeb
Reactive
}
* annotation and extending directly from {@link Web
Reactive
ConfigurationSupport}
* or {@link DelegatingWeb
Reactive
Configuration} if you still want to allow
* {@link Web
Reactive
Configurer} instances to customize the configuration.
* <p>If {@link Web
Flux
Configurer} does not expose some more advanced setting
* that needs to be configured consider removing the {@code @EnableWeb
Flux
}
* annotation and extending directly from {@link Web
Flux
ConfigurationSupport}
* or {@link DelegatingWeb
Flux
Configuration} if you still want to allow
* {@link Web
Flux
Configurer} instances to customize the configuration.
*
* @author Brian Clozel
* @author Rossen Stoyanchev
* @since 5.0
* @see Web
Reactive
Configurer
* @see Web
Reactive
ConfigurationSupport
* @see Web
Flux
Configurer
* @see Web
Flux
ConfigurationSupport
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
(
ElementType
.
TYPE
)
@Documented
@Import
(
DelegatingWeb
Reactive
Configuration
.
class
)
public
@interface
EnableWeb
Reactive
{
@Import
(
DelegatingWeb
Flux
Configuration
.
class
)
public
@interface
EnableWeb
Flux
{
}
spring-webflux/src/main/java/org/springframework/web/reactive/config/Web
Reactive
ConfigurationSupport.java
→
spring-webflux/src/main/java/org/springframework/web/reactive/config/Web
Flux
ConfigurationSupport.java
浏览文件 @
73999567
...
...
@@ -90,16 +90,16 @@ import org.springframework.web.server.handler.ResponseStatusExceptionHandler;
* @author Rossen Stoyanchev
* @since 5.0
*/
public
class
Web
Reactive
ConfigurationSupport
implements
ApplicationContextAware
{
public
class
Web
Flux
ConfigurationSupport
implements
ApplicationContextAware
{
private
static
final
boolean
jackson2Present
=
ClassUtils
.
isPresent
(
"com.fasterxml.jackson.databind.ObjectMapper"
,
Web
Reactive
ConfigurationSupport
.
class
.
getClassLoader
())
&&
Web
Flux
ConfigurationSupport
.
class
.
getClassLoader
())
&&
ClassUtils
.
isPresent
(
"com.fasterxml.jackson.core.JsonGenerator"
,
Web
Reactive
ConfigurationSupport
.
class
.
getClassLoader
());
Web
Flux
ConfigurationSupport
.
class
.
getClassLoader
());
private
static
final
boolean
jaxb2Present
=
ClassUtils
.
isPresent
(
"javax.xml.bind.Binder"
,
Web
Reactive
ConfigurationSupport
.
class
.
getClassLoader
());
ClassUtils
.
isPresent
(
"javax.xml.bind.Binder"
,
Web
Flux
ConfigurationSupport
.
class
.
getClassLoader
());
private
Map
<
String
,
CorsConfiguration
>
corsConfigurations
;
...
...
@@ -138,7 +138,7 @@ public class WebReactiveConfigurationSupport implements ApplicationContextAware
public
RequestMappingHandlerMapping
requestMappingHandlerMapping
()
{
RequestMappingHandlerMapping
mapping
=
createRequestMappingHandlerMapping
();
mapping
.
setOrder
(
0
);
mapping
.
setContentTypeResolver
(
web
Reactive
ContentTypeResolver
());
mapping
.
setContentTypeResolver
(
web
Flux
ContentTypeResolver
());
mapping
.
setCorsConfigurations
(
getCorsConfigurations
());
PathMatchConfigurer
configurer
=
getPathMatchConfigurer
();
...
...
@@ -169,7 +169,7 @@ public class WebReactiveConfigurationSupport implements ApplicationContextAware
}
@Bean
public
CompositeContentTypeResolver
web
Reactive
ContentTypeResolver
()
{
public
CompositeContentTypeResolver
web
Flux
ContentTypeResolver
()
{
RequestedContentTypeResolverBuilder
builder
=
new
RequestedContentTypeResolverBuilder
();
builder
.
mediaTypes
(
getDefaultMediaTypeMappings
());
configureContentTypeResolver
(
builder
);
...
...
@@ -240,7 +240,7 @@ public class WebReactiveConfigurationSupport implements ApplicationContextAware
@Bean
public
HandlerMapping
resourceHandlerMapping
()
{
ResourceHandlerRegistry
registry
=
new
ResourceHandlerRegistry
(
this
.
applicationContext
,
web
Reactive
ContentTypeResolver
());
new
ResourceHandlerRegistry
(
this
.
applicationContext
,
web
Flux
ContentTypeResolver
());
addResourceHandlers
(
registry
);
AbstractHandlerMapping
handlerMapping
=
registry
.
getHandlerMapping
();
...
...
@@ -271,7 +271,7 @@ public class WebReactiveConfigurationSupport implements ApplicationContextAware
RequestMappingHandlerAdapter
adapter
=
createRequestMappingHandlerAdapter
();
adapter
.
setMessageReaders
(
getMessageReaders
());
adapter
.
setWebBindingInitializer
(
getConfigurableWebBindingInitializer
());
adapter
.
setReactiveAdapterRegistry
(
web
Reactive
AdapterRegistry
());
adapter
.
setReactiveAdapterRegistry
(
web
Flux
AdapterRegistry
());
List
<
HandlerMethodArgumentResolver
>
resolvers
=
new
ArrayList
<>();
addArgumentResolvers
(
resolvers
);
...
...
@@ -357,14 +357,14 @@ public class WebReactiveConfigurationSupport implements ApplicationContextAware
*/
protected
ConfigurableWebBindingInitializer
getConfigurableWebBindingInitializer
()
{
ConfigurableWebBindingInitializer
initializer
=
new
ConfigurableWebBindingInitializer
();
initializer
.
setConversionService
(
web
Reactive
ConversionService
());
initializer
.
setValidator
(
web
Reactive
Validator
());
initializer
.
setConversionService
(
web
Flux
ConversionService
());
initializer
.
setValidator
(
web
Flux
Validator
());
initializer
.
setMessageCodesResolver
(
getMessageCodesResolver
());
return
initializer
;
}
@Bean
public
FormattingConversionService
web
Reactive
ConversionService
()
{
public
FormattingConversionService
web
Flux
ConversionService
()
{
FormattingConversionService
service
=
new
DefaultFormattingConversionService
();
addFormatters
(
service
);
return
service
;
...
...
@@ -380,7 +380,7 @@ public class WebReactiveConfigurationSupport implements ApplicationContextAware
* Return a {@link ReactiveAdapterRegistry} to adapting reactive types.
*/
@Bean
public
ReactiveAdapterRegistry
web
Reactive
AdapterRegistry
()
{
public
ReactiveAdapterRegistry
web
Flux
AdapterRegistry
()
{
return
new
ReactiveAdapterRegistry
();
}
...
...
@@ -393,7 +393,7 @@ public class WebReactiveConfigurationSupport implements ApplicationContextAware
* implementation is not available, a "no-op" {@link Validator} is returned.
*/
@Bean
public
Validator
web
Reactive
Validator
()
{
public
Validator
web
Flux
Validator
()
{
Validator
validator
=
getValidator
();
if
(
validator
==
null
)
{
if
(
ClassUtils
.
isPresent
(
"javax.validation.Validator"
,
getClass
().
getClassLoader
()))
{
...
...
@@ -439,13 +439,13 @@ public class WebReactiveConfigurationSupport implements ApplicationContextAware
@Bean
public
ResponseEntityResultHandler
responseEntityResultHandler
()
{
return
new
ResponseEntityResultHandler
(
getMessageWriters
(),
web
ReactiveContentTypeResolver
(),
webReactive
AdapterRegistry
());
getMessageWriters
(),
web
FluxContentTypeResolver
(),
webFlux
AdapterRegistry
());
}
@Bean
public
ResponseBodyResultHandler
responseBodyResultHandler
()
{
return
new
ResponseBodyResultHandler
(
getMessageWriters
(),
web
ReactiveContentTypeResolver
(),
webReactive
AdapterRegistry
());
getMessageWriters
(),
web
FluxContentTypeResolver
(),
webFlux
AdapterRegistry
());
}
/**
...
...
@@ -512,7 +512,7 @@ public class WebReactiveConfigurationSupport implements ApplicationContextAware
configureViewResolvers
(
registry
);
List
<
ViewResolver
>
resolvers
=
registry
.
getViewResolvers
();
ViewResolutionResultHandler
handler
=
new
ViewResolutionResultHandler
(
resolvers
,
web
ReactiveContentTypeResolver
(),
webReactive
AdapterRegistry
());
resolvers
,
web
FluxContentTypeResolver
(),
webFlux
AdapterRegistry
());
handler
.
setDefaultViews
(
registry
.
getDefaultViews
());
handler
.
setOrder
(
registry
.
getOrder
());
return
handler
;
...
...
spring-webflux/src/main/java/org/springframework/web/reactive/config/Web
Reactive
Configurer.java
→
spring-webflux/src/main/java/org/springframework/web/reactive/config/Web
Flux
Configurer.java
浏览文件 @
73999567
...
...
@@ -33,9 +33,9 @@ import org.springframework.web.reactive.result.method.HandlerMethodArgumentResol
/**
* Defines callback methods to customize the configuration for Web Reactive
* applications enabled via {@code @EnableWeb
Reactive
}.
* applications enabled via {@code @EnableWeb
Flux
}.
*
* <p>{@code @EnableWeb
Reactive
}-annotated configuration classes may implement
* <p>{@code @EnableWeb
Flux
}-annotated configuration classes may implement
* this interface to be called back and given a chance to customize the
* default configuration. Consider implementing this interface and
* overriding the relevant methods for your needs.
...
...
@@ -44,7 +44,7 @@ import org.springframework.web.reactive.result.method.HandlerMethodArgumentResol
* @author Rossen Stoyanchev
* @since 5.0
*/
public
interface
Web
Reactive
Configurer
{
public
interface
Web
Flux
Configurer
{
/**
* Configure how the content type requested for the response is resolved.
...
...
@@ -92,7 +92,7 @@ public interface WebReactiveConfigurer {
* Configure the message readers to use for decoding the request body where
* {@code @RequestBody} and {@code HttpEntity} controller method arguments
* are used. If none are specified, default ones are added based on
* {@link Web
Reactive
ConfigurationSupport#addDefaultHttpMessageReaders}.
* {@link Web
Flux
ConfigurationSupport#addDefaultHttpMessageReaders}.
* <p>See {@link #extendMessageReaders(List)} for adding readers
* in addition to the default ones.
* @param readers an empty list to add message readers to
...
...
@@ -136,7 +136,7 @@ public interface WebReactiveConfigurer {
* Configure the message writers to use to encode the response body based on
* the return values of {@code @ResponseBody}, and {@code ResponseEntity}
* controller methods. If none are specified, default ones are added based on
* {@link Web
Reactive
ConfigurationSupport#addDefaultHttpMessageWriters(List)}.
* {@link Web
Flux
ConfigurationSupport#addDefaultHttpMessageWriters(List)}.
* <p>See {@link #extendMessageWriters(List)} for adding writers
* in addition to the default ones.
* @param writers a empty list to add message writers to
...
...
spring-webflux/src/main/java/org/springframework/web/reactive/config/Web
Reactive
ConfigurerComposite.java
→
spring-webflux/src/main/java/org/springframework/web/reactive/config/Web
Flux
ConfigurerComposite.java
浏览文件 @
73999567
...
...
@@ -32,18 +32,18 @@ import org.springframework.web.reactive.accept.RequestedContentTypeResolverBuild
import
org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver
;
/**
* A {@link Web
Reactive
Configurer} that delegates to one or more others.
* A {@link Web
Flux
Configurer} that delegates to one or more others.
*
* @author Brian Clozel
* @author Rossen Stoyanchev
* @since 5.0
*/
public
class
Web
ReactiveConfigurerComposite
implements
WebReactive
Configurer
{
public
class
Web
FluxConfigurerComposite
implements
WebFlux
Configurer
{
private
final
List
<
Web
Reactive
Configurer
>
delegates
=
new
ArrayList
<>();
private
final
List
<
Web
Flux
Configurer
>
delegates
=
new
ArrayList
<>();
public
void
addWeb
ReactiveConfigurers
(
List
<
WebReactive
Configurer
>
configurers
)
{
public
void
addWeb
FluxConfigurers
(
List
<
WebFlux
Configurer
>
configurers
)
{
if
(!
CollectionUtils
.
isEmpty
(
configurers
))
{
this
.
delegates
.
addAll
(
configurers
);
}
...
...
@@ -92,12 +92,12 @@ public class WebReactiveConfigurerComposite implements WebReactiveConfigurer {
@Override
public
Optional
<
Validator
>
getValidator
()
{
return
createSingleBean
(
Web
Reactive
Configurer:
:
getValidator
,
Validator
.
class
);
return
createSingleBean
(
Web
Flux
Configurer:
:
getValidator
,
Validator
.
class
);
}
@Override
public
Optional
<
MessageCodesResolver
>
getMessageCodesResolver
()
{
return
createSingleBean
(
Web
Reactive
Configurer:
:
getMessageCodesResolver
,
MessageCodesResolver
.
class
);
return
createSingleBean
(
Web
Flux
Configurer:
:
getMessageCodesResolver
,
MessageCodesResolver
.
class
);
}
@Override
...
...
@@ -115,7 +115,7 @@ public class WebReactiveConfigurerComposite implements WebReactiveConfigurer {
this
.
delegates
.
stream
().
forEach
(
delegate
->
delegate
.
configureViewResolvers
(
registry
));
}
private
<
T
>
Optional
<
T
>
createSingleBean
(
Function
<
Web
Reactive
Configurer
,
Optional
<
T
>>
factory
,
private
<
T
>
Optional
<
T
>
createSingleBean
(
Function
<
Web
Flux
Configurer
,
Optional
<
T
>>
factory
,
Class
<
T
>
beanType
)
{
List
<
Optional
<
T
>>
result
=
this
.
delegates
.
stream
()
...
...
@@ -128,7 +128,7 @@ public class WebReactiveConfigurerComposite implements WebReactiveConfigurer {
return
result
.
get
(
0
);
}
else
{
throw
new
IllegalStateException
(
"More than one Web
Reactive
Configurer implements "
+
throw
new
IllegalStateException
(
"More than one Web
Flux
Configurer implements "
+
beanType
.
getSimpleName
()
+
" factory method."
);
}
}
...
...
spring-webflux/src/main/java/org/springframework/web/reactive/resource/AppCacheManifestTransformer.java
浏览文件 @
73999567
...
...
@@ -61,7 +61,7 @@ import org.springframework.web.server.ServerWebExchange;
* <p>In order to serve manifest files with the proper {@code "text/manifest"} content type,
* it is required to configure it with
* {@code requestedContentTypeResolverBuilder.mediaType("appcache", MediaType.valueOf("text/manifest")}
* in {@code Web
ReactiveConfiguration
.configureContentTypeResolver()}.
* in {@code Web
FluxConfigurer
.configureContentTypeResolver()}.
*
* @author Rossen Stoyanchev
* @author Brian Clozel
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/config/DelegatingWeb
Reactive
ConfigurationTests.java
→
spring-webflux/src/test/java/org/springframework/web/reactive/config/DelegatingWeb
Flux
ConfigurationTests.java
浏览文件 @
73999567
...
...
@@ -46,16 +46,16 @@ import static org.mockito.BDDMockito.given;
import
static
org
.
mockito
.
BDDMockito
.
verify
;
/**
* Test fixture for {@link DelegatingWeb
Reactive
Configuration} tests.
* Test fixture for {@link DelegatingWeb
Flux
Configuration} tests.
*
* @author Brian Clozel
*/
public
class
DelegatingWeb
Reactive
ConfigurationTests
{
public
class
DelegatingWeb
Flux
ConfigurationTests
{
private
DelegatingWeb
Reactive
Configuration
delegatingConfig
;
private
DelegatingWeb
Flux
Configuration
delegatingConfig
;
@Mock
private
Web
ReactiveConfigurer
webReactive
Configurer
;
private
Web
FluxConfigurer
webFlux
Configurer
;
@Captor
private
ArgumentCaptor
<
List
<
HttpMessageReader
<?>>>
readers
;
...
...
@@ -70,38 +70,38 @@ public class DelegatingWebReactiveConfigurationTests {
@Before
public
void
setUp
()
{
MockitoAnnotations
.
initMocks
(
this
);
delegatingConfig
=
new
DelegatingWeb
Reactive
Configuration
();
delegatingConfig
=
new
DelegatingWeb
Flux
Configuration
();
delegatingConfig
.
setApplicationContext
(
new
StaticApplicationContext
());
given
(
web
Reactive
Configurer
.
getValidator
()).
willReturn
(
Optional
.
empty
());
given
(
web
Reactive
Configurer
.
getMessageCodesResolver
()).
willReturn
(
Optional
.
empty
());
given
(
web
Flux
Configurer
.
getValidator
()).
willReturn
(
Optional
.
empty
());
given
(
web
Flux
Configurer
.
getMessageCodesResolver
()).
willReturn
(
Optional
.
empty
());
}
@Test
public
void
requestMappingHandlerMapping
()
throws
Exception
{
delegatingConfig
.
setConfigurers
(
Collections
.
singletonList
(
web
Reactive
Configurer
));
delegatingConfig
.
setConfigurers
(
Collections
.
singletonList
(
web
Flux
Configurer
));
delegatingConfig
.
requestMappingHandlerMapping
();
verify
(
web
Reactive
Configurer
).
configureContentTypeResolver
(
any
(
RequestedContentTypeResolverBuilder
.
class
));
verify
(
web
Reactive
Configurer
).
addCorsMappings
(
any
(
CorsRegistry
.
class
));
verify
(
web
Reactive
Configurer
).
configurePathMatching
(
any
(
PathMatchConfigurer
.
class
));
verify
(
web
Flux
Configurer
).
configureContentTypeResolver
(
any
(
RequestedContentTypeResolverBuilder
.
class
));
verify
(
web
Flux
Configurer
).
addCorsMappings
(
any
(
CorsRegistry
.
class
));
verify
(
web
Flux
Configurer
).
configurePathMatching
(
any
(
PathMatchConfigurer
.
class
));
}
@Test
public
void
requestMappingHandlerAdapter
()
throws
Exception
{
delegatingConfig
.
setConfigurers
(
Collections
.
singletonList
(
web
Reactive
Configurer
));
delegatingConfig
.
setConfigurers
(
Collections
.
singletonList
(
web
Flux
Configurer
));
RequestMappingHandlerAdapter
adapter
=
delegatingConfig
.
requestMappingHandlerAdapter
();
ConfigurableWebBindingInitializer
initializer
=
(
ConfigurableWebBindingInitializer
)
adapter
.
getWebBindingInitializer
();
ConversionService
initializerConversionService
=
initializer
.
getConversionService
();
assertTrue
(
initializer
.
getValidator
()
instanceof
LocalValidatorFactoryBean
);
verify
(
web
Reactive
Configurer
).
configureMessageReaders
(
readers
.
capture
());
verify
(
web
Reactive
Configurer
).
extendMessageReaders
(
readers
.
capture
());
verify
(
web
Reactive
Configurer
).
getValidator
();
verify
(
web
Reactive
Configurer
).
getMessageCodesResolver
();
verify
(
web
Reactive
Configurer
).
addFormatters
(
formatterRegistry
.
capture
());
verify
(
web
Reactive
Configurer
).
addArgumentResolvers
(
any
());
verify
(
web
Flux
Configurer
).
configureMessageReaders
(
readers
.
capture
());
verify
(
web
Flux
Configurer
).
extendMessageReaders
(
readers
.
capture
());
verify
(
web
Flux
Configurer
).
getValidator
();
verify
(
web
Flux
Configurer
).
getMessageCodesResolver
();
verify
(
web
Flux
Configurer
).
addFormatters
(
formatterRegistry
.
capture
());
verify
(
web
Flux
Configurer
).
addArgumentResolvers
(
any
());
assertSame
(
formatterRegistry
.
getValue
(),
initializerConversionService
);
assertEquals
(
7
,
readers
.
getValue
().
size
());
...
...
@@ -109,34 +109,34 @@ public class DelegatingWebReactiveConfigurationTests {
@Test
public
void
resourceHandlerMapping
()
throws
Exception
{
delegatingConfig
.
setConfigurers
(
Collections
.
singletonList
(
web
Reactive
Configurer
));
delegatingConfig
.
setConfigurers
(
Collections
.
singletonList
(
web
Flux
Configurer
));
doAnswer
(
invocation
->
{
ResourceHandlerRegistry
registry
=
invocation
.
getArgument
(
0
);
registry
.
addResourceHandler
(
"/static/**"
).
addResourceLocations
(
"classpath:/static"
);
return
null
;
}).
when
(
web
Reactive
Configurer
).
addResourceHandlers
(
any
(
ResourceHandlerRegistry
.
class
));
}).
when
(
web
Flux
Configurer
).
addResourceHandlers
(
any
(
ResourceHandlerRegistry
.
class
));
delegatingConfig
.
resourceHandlerMapping
();
verify
(
web
Reactive
Configurer
).
addResourceHandlers
(
any
(
ResourceHandlerRegistry
.
class
));
verify
(
web
Reactive
Configurer
).
configurePathMatching
(
any
(
PathMatchConfigurer
.
class
));
verify
(
web
Flux
Configurer
).
addResourceHandlers
(
any
(
ResourceHandlerRegistry
.
class
));
verify
(
web
Flux
Configurer
).
configurePathMatching
(
any
(
PathMatchConfigurer
.
class
));
}
@Test
public
void
responseBodyResultHandler
()
throws
Exception
{
delegatingConfig
.
setConfigurers
(
Collections
.
singletonList
(
web
Reactive
Configurer
));
delegatingConfig
.
setConfigurers
(
Collections
.
singletonList
(
web
Flux
Configurer
));
delegatingConfig
.
responseBodyResultHandler
();
verify
(
web
Reactive
Configurer
).
configureMessageWriters
(
writers
.
capture
());
verify
(
web
Reactive
Configurer
).
extendMessageWriters
(
writers
.
capture
());
verify
(
web
Reactive
Configurer
).
configureContentTypeResolver
(
any
(
RequestedContentTypeResolverBuilder
.
class
));
verify
(
web
Flux
Configurer
).
configureMessageWriters
(
writers
.
capture
());
verify
(
web
Flux
Configurer
).
extendMessageWriters
(
writers
.
capture
());
verify
(
web
Flux
Configurer
).
configureContentTypeResolver
(
any
(
RequestedContentTypeResolverBuilder
.
class
));
}
@Test
public
void
viewResolutionResultHandler
()
throws
Exception
{
delegatingConfig
.
setConfigurers
(
Collections
.
singletonList
(
web
Reactive
Configurer
));
delegatingConfig
.
setConfigurers
(
Collections
.
singletonList
(
web
Flux
Configurer
));
delegatingConfig
.
viewResolutionResultHandler
();
verify
(
web
Reactive
Configurer
).
configureViewResolvers
(
any
(
ViewResolverRegistry
.
class
));
verify
(
web
Flux
Configurer
).
configureViewResolvers
(
any
(
ViewResolverRegistry
.
class
));
}
}
spring-webflux/src/test/java/org/springframework/web/reactive/config/Web
Reactive
ConfigurationSupportTests.java
→
spring-webflux/src/test/java/org/springframework/web/reactive/config/Web
Flux
ConfigurationSupportTests.java
浏览文件 @
73999567
...
...
@@ -78,10 +78,10 @@ import static org.springframework.http.MediaType.IMAGE_PNG;
import
static
org
.
springframework
.
http
.
MediaType
.
TEXT_PLAIN
;
/**
* Unit tests for {@link Web
Reactive
ConfigurationSupport}.
* Unit tests for {@link Web
Flux
ConfigurationSupport}.
* @author Rossen Stoyanchev
*/
public
class
Web
Reactive
ConfigurationSupportTests
{
public
class
Web
Flux
ConfigurationSupportTests
{
private
MockServerHttpRequest
request
;
...
...
@@ -94,7 +94,7 @@ public class WebReactiveConfigurationSupportTests {
@Test
public
void
requestMappingHandlerMapping
()
throws
Exception
{
ApplicationContext
context
=
loadConfig
(
Web
Reactive
Config
.
class
);
ApplicationContext
context
=
loadConfig
(
Web
Flux
Config
.
class
);
String
name
=
"requestMappingHandlerMapping"
;
RequestMappingHandlerMapping
mapping
=
context
.
getBean
(
name
,
RequestMappingHandlerMapping
.
class
);
...
...
@@ -106,7 +106,7 @@ public class WebReactiveConfigurationSupportTests {
assertTrue
(
mapping
.
useTrailingSlashMatch
());
assertTrue
(
mapping
.
useRegisteredSuffixPatternMatch
());
name
=
"web
Reactive
ContentTypeResolver"
;
name
=
"web
Flux
ContentTypeResolver"
;
RequestedContentTypeResolver
resolver
=
context
.
getBean
(
name
,
RequestedContentTypeResolver
.
class
);
assertSame
(
resolver
,
mapping
.
getContentTypeResolver
());
...
...
@@ -132,7 +132,7 @@ public class WebReactiveConfigurationSupportTests {
@Test
public
void
requestMappingHandlerAdapter
()
throws
Exception
{
ApplicationContext
context
=
loadConfig
(
Web
Reactive
Config
.
class
);
ApplicationContext
context
=
loadConfig
(
Web
Flux
Config
.
class
);
String
name
=
"requestMappingHandlerAdapter"
;
RequestMappingHandlerAdapter
adapter
=
context
.
getBean
(
name
,
RequestMappingHandlerAdapter
.
class
);
...
...
@@ -154,11 +154,11 @@ public class WebReactiveConfigurationSupportTests {
WebExchangeDataBinder
binder
=
new
WebExchangeDataBinder
(
new
Object
());
bindingInitializer
.
initBinder
(
binder
);
name
=
"web
Reactive
ConversionService"
;
name
=
"web
Flux
ConversionService"
;
ConversionService
service
=
context
.
getBean
(
name
,
ConversionService
.
class
);
assertSame
(
service
,
binder
.
getConversionService
());
name
=
"web
Reactive
Validator"
;
name
=
"web
Flux
Validator"
;
Validator
validator
=
context
.
getBean
(
name
,
Validator
.
class
);
assertSame
(
validator
,
binder
.
getValidator
());
}
...
...
@@ -180,7 +180,7 @@ public class WebReactiveConfigurationSupportTests {
@Test
public
void
responseEntityResultHandler
()
throws
Exception
{
ApplicationContext
context
=
loadConfig
(
Web
Reactive
Config
.
class
);
ApplicationContext
context
=
loadConfig
(
Web
Flux
Config
.
class
);
String
name
=
"responseEntityResultHandler"
;
ResponseEntityResultHandler
handler
=
context
.
getBean
(
name
,
ResponseEntityResultHandler
.
class
);
...
...
@@ -199,14 +199,14 @@ public class WebReactiveConfigurationSupportTests {
assertHasMessageWriter
(
writers
,
TestBean
.
class
,
APPLICATION_JSON
);
assertHasMessageWriter
(
writers
,
TestBean
.
class
,
MediaType
.
parseMediaType
(
"text/event-stream"
));
name
=
"web
Reactive
ContentTypeResolver"
;
name
=
"web
Flux
ContentTypeResolver"
;
RequestedContentTypeResolver
resolver
=
context
.
getBean
(
name
,
RequestedContentTypeResolver
.
class
);
assertSame
(
resolver
,
handler
.
getContentTypeResolver
());
}
@Test
public
void
responseBodyResultHandler
()
throws
Exception
{
ApplicationContext
context
=
loadConfig
(
Web
Reactive
Config
.
class
);
ApplicationContext
context
=
loadConfig
(
Web
Flux
Config
.
class
);
String
name
=
"responseBodyResultHandler"
;
ResponseBodyResultHandler
handler
=
context
.
getBean
(
name
,
ResponseBodyResultHandler
.
class
);
...
...
@@ -225,7 +225,7 @@ public class WebReactiveConfigurationSupportTests {
assertHasMessageWriter
(
writers
,
TestBean
.
class
,
APPLICATION_JSON
);
assertHasMessageWriter
(
writers
,
TestBean
.
class
,
null
);
name
=
"web
Reactive
ContentTypeResolver"
;
name
=
"web
Flux
ContentTypeResolver"
;
RequestedContentTypeResolver
resolver
=
context
.
getBean
(
name
,
RequestedContentTypeResolver
.
class
);
assertSame
(
resolver
,
handler
.
getContentTypeResolver
());
}
...
...
@@ -298,12 +298,12 @@ public class WebReactiveConfigurationSupportTests {
return
context
;
}
@EnableWeb
Reactive
static
class
Web
Reactive
Config
{
@EnableWeb
Flux
static
class
Web
Flux
Config
{
}
@Configuration
static
class
CustomPatchMatchConfig
extends
Web
Reactive
ConfigurationSupport
{
static
class
CustomPatchMatchConfig
extends
Web
Flux
ConfigurationSupport
{
@Override
public
void
configurePathMatching
(
PathMatchConfigurer
configurer
)
{
...
...
@@ -313,7 +313,7 @@ public class WebReactiveConfigurationSupportTests {
}
@Configuration
static
class
CustomMessageConverterConfig
extends
Web
Reactive
ConfigurationSupport
{
static
class
CustomMessageConverterConfig
extends
Web
Flux
ConfigurationSupport
{
@Override
protected
void
configureMessageReaders
(
List
<
HttpMessageReader
<?>>
messageReaders
)
{
...
...
@@ -338,7 +338,7 @@ public class WebReactiveConfigurationSupportTests {
@Configuration
@SuppressWarnings
(
"unused"
)
static
class
CustomViewResolverConfig
extends
Web
Reactive
ConfigurationSupport
{
static
class
CustomViewResolverConfig
extends
Web
Flux
ConfigurationSupport
{
@Override
protected
void
configureViewResolvers
(
ViewResolverRegistry
registry
)
{
...
...
@@ -354,7 +354,7 @@ public class WebReactiveConfigurationSupportTests {
}
@Configuration
static
class
CustomResourceHandlingConfig
extends
Web
Reactive
ConfigurationSupport
{
static
class
CustomResourceHandlingConfig
extends
Web
Flux
ConfigurationSupport
{
@Override
protected
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/function/server/DispatcherHandlerIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -41,7 +41,7 @@ import org.springframework.web.client.RestTemplate;
import
org.springframework.web.reactive.DispatcherHandler
;
import
org.springframework.web.reactive.HandlerAdapter
;
import
org.springframework.web.reactive.HandlerMapping
;
import
org.springframework.web.reactive.config.Web
Reactive
ConfigurationSupport
;
import
org.springframework.web.reactive.config.Web
Flux
ConfigurationSupport
;
import
org.springframework.web.reactive.function.server.support.HandlerFunctionAdapter
;
import
org.springframework.web.reactive.function.server.support.ServerResponseResultHandler
;
import
org.springframework.web.reactive.result.view.ViewResolver
;
...
...
@@ -105,7 +105,7 @@ public class DispatcherHandlerIntegrationTests extends AbstractHttpHandlerIntegr
@Configuration
static
class
TestConfiguration
extends
Web
Reactive
ConfigurationSupport
{
static
class
TestConfiguration
extends
Web
Flux
ConfigurationSupport
{
@Bean
public
PersonHandler
personHandler
()
{
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/BindingContextFactoryTests.java
浏览文件 @
73999567
...
...
@@ -37,7 +37,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.support.WebExchangeDataBinder
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.reactive.BindingContext
;
import
org.springframework.web.reactive.config.Web
Reactive
ConfigurationSupport
;
import
org.springframework.web.reactive.config.Web
Flux
ConfigurationSupport
;
import
org.springframework.web.reactive.result.ResolvableMethod
;
import
org.springframework.web.server.ServerWebExchange
;
import
org.springframework.web.server.adapter.DefaultServerWebExchange
;
...
...
@@ -58,7 +58,7 @@ public class BindingContextFactoryTests {
@Before
public
void
setUp
()
throws
Exception
{
Web
ReactiveConfigurationSupport
configurationSupport
=
new
WebReactive
ConfigurationSupport
();
Web
FluxConfigurationSupport
configurationSupport
=
new
WebFlux
ConfigurationSupport
();
configurationSupport
.
setApplicationContext
(
new
StaticApplicationContext
());
RequestMappingHandlerAdapter
adapter
=
configurationSupport
.
requestMappingHandlerAdapter
();
adapter
.
afterPropertiesSet
();
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ContextPathIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.reactive.DispatcherHandler
;
import
org.springframework.web.reactive.config.EnableWeb
Reactive
;
import
org.springframework.web.reactive.config.EnableWeb
Flux
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
...
@@ -92,7 +92,7 @@ public class ContextPathIntegrationTests {
}
@EnableWeb
Reactive
@EnableWeb
Flux
@Configuration
static
class
WebApp1Config
{
...
...
@@ -102,7 +102,7 @@ public class ContextPathIntegrationTests {
}
}
@EnableWeb
Reactive
@EnableWeb
Flux
@Configuration
static
class
WebApp2Config
{
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/CrossOriginAnnotationIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -39,7 +39,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.reactive.config.EnableWeb
Reactive
;
import
org.springframework.web.reactive.config.EnableWeb
Flux
;
import
static
org
.
junit
.
Assert
.
assertArrayEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
...
@@ -222,7 +222,7 @@ public class CrossOriginAnnotationIntegrationTests extends AbstractRequestMappin
@Configuration
@EnableWeb
Reactive
@EnableWeb
Flux
@ComponentScan
(
resourcePattern
=
"**/CrossOriginAnnotationIntegrationTests*"
)
@SuppressWarnings
({
"unused"
,
"WeakerAccess"
})
static
class
WebConfig
{
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/GlobalCorsConfigIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -32,7 +32,7 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.client.HttpClientErrorException
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.reactive.config.CorsRegistry
;
import
org.springframework.web.reactive.config.Web
Reactive
ConfigurationSupport
;
import
org.springframework.web.reactive.config.Web
Flux
ConfigurationSupport
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNull
;
...
...
@@ -137,7 +137,7 @@ public class GlobalCorsConfigIntegrationTests extends AbstractRequestMappingInte
@Configuration
@ComponentScan
(
resourcePattern
=
"**/GlobalCorsConfigIntegrationTests*.class"
)
@SuppressWarnings
({
"unused"
,
"WeakerAccess"
})
static
class
WebConfig
extends
Web
Reactive
ConfigurationSupport
{
static
class
WebConfig
extends
Web
Flux
ConfigurationSupport
{
@Override
protected
void
addCorsMappings
(
CorsRegistry
registry
)
{
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/JacksonHintsIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -34,7 +34,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.reactive.config.EnableWeb
Reactive
;
import
org.springframework.web.reactive.config.EnableWeb
Flux
;
/**
* @author Sebastien Deleuze
...
...
@@ -93,7 +93,7 @@ public class JacksonHintsIntegrationTests extends AbstractRequestMappingIntegrat
@Configuration
@ComponentScan
(
resourcePattern
=
"**/JacksonHintsIntegrationTests*.class"
)
@EnableWeb
Reactive
@EnableWeb
Flux
@SuppressWarnings
({
"unused"
,
"WeakerAccess"
})
static
class
WebConfig
{
}
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingDataBindingIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -40,7 +40,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.reactive.config.EnableWeb
Reactive
;
import
org.springframework.web.reactive.config.EnableWeb
Flux
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
...
@@ -83,7 +83,7 @@ public class RequestMappingDataBindingIntegrationTests extends AbstractRequestMa
@Configuration
@EnableWeb
Reactive
@EnableWeb
Flux
@ComponentScan
(
resourcePattern
=
"**/RequestMappingDataBindingIntegrationTests*.class"
)
@SuppressWarnings
({
"unused"
,
"WeakerAccess"
})
static
class
WebConfig
{
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingExceptionHandlingIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -29,7 +29,7 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.reactive.config.EnableWeb
Reactive
;
import
org.springframework.web.reactive.config.EnableWeb
Flux
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
...
@@ -65,7 +65,7 @@ public class RequestMappingExceptionHandlingIntegrationTests extends AbstractReq
@Configuration
@EnableWeb
Reactive
@EnableWeb
Flux
@ComponentScan
(
resourcePattern
=
"**/RequestMappingExceptionHandlingIntegrationTests$*.class"
)
@SuppressWarnings
({
"unused"
,
"WeakerAccess"
})
static
class
WebConfig
{
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -29,7 +29,7 @@ import org.springframework.http.MediaType;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.reactive.config.EnableWeb
Reactive
;
import
org.springframework.web.reactive.config.EnableWeb
Flux
;
import
static
org
.
junit
.
Assert
.
assertArrayEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
...
@@ -80,7 +80,7 @@ public class RequestMappingIntegrationTests extends AbstractRequestMappingIntegr
@Configuration
@EnableWeb
Reactive
@EnableWeb
Flux
@ComponentScan
(
resourcePattern
=
"**/RequestMappingIntegrationTests$*.class"
)
@SuppressWarnings
({
"unused"
,
"WeakerAccess"
})
static
class
WebConfig
{
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingMessageConversionIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -57,7 +57,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.reactive.config.EnableWeb
Reactive
;
import
org.springframework.web.reactive.config.EnableWeb
Flux
;
import
static
java
.
util
.
Arrays
.
asList
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
...
@@ -380,7 +380,7 @@ public class RequestMappingMessageConversionIntegrationTests extends AbstractReq
@Configuration
@EnableWeb
Reactive
@EnableWeb
Flux
@ComponentScan
(
resourcePattern
=
"**/RequestMappingMessageConversionIntegrationTests$*.class"
)
@SuppressWarnings
({
"unused"
,
"WeakerAccess"
})
static
class
WebConfig
{
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingViewResolutionIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -35,7 +35,7 @@ import org.springframework.ui.Model;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.reactive.config.ViewResolverRegistry
;
import
org.springframework.web.reactive.config.Web
Reactive
ConfigurationSupport
;
import
org.springframework.web.reactive.config.Web
Flux
ConfigurationSupport
;
import
org.springframework.web.reactive.result.view.freemarker.FreeMarkerConfigurer
;
import
org.springframework.web.server.ServerWebExchange
;
...
...
@@ -81,7 +81,7 @@ public class RequestMappingViewResolutionIntegrationTests extends AbstractReques
@Configuration
@ComponentScan
(
resourcePattern
=
"**/RequestMappingViewResolutionIntegrationTests$*.class"
)
@SuppressWarnings
({
"unused"
,
"WeakerAccess"
})
static
class
WebConfig
extends
Web
Reactive
ConfigurationSupport
{
static
class
WebConfig
extends
Web
Flux
ConfigurationSupport
{
@Override
protected
void
configureViewResolvers
(
ViewResolverRegistry
registry
)
{
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/SseIntegrationTests.java
浏览文件 @
73999567
...
...
@@ -33,7 +33,7 @@ import org.springframework.http.server.reactive.HttpHandler;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.reactive.DispatcherHandler
;
import
org.springframework.web.reactive.config.EnableWeb
Reactive
;
import
org.springframework.web.reactive.config.EnableWeb
Flux
;
import
org.springframework.web.reactive.function.client.WebClient
;
import
org.springframework.web.server.adapter.WebHttpHandlerBuilder
;
...
...
@@ -181,7 +181,7 @@ public class SseIntegrationTests extends AbstractHttpHandlerIntegrationTests {
}
@Configuration
@EnableWeb
Reactive
@EnableWeb
Flux
@SuppressWarnings
(
"unused"
)
static
class
TestConfiguration
{
...
...
src/asciidoc/web-flux.adoc
浏览文件 @
73999567
...
...
@@ -303,7 +303,7 @@ For the **annotation-based programming model** bootstrap with:
[source,java,indent=0]
[subs="verbatim,quotes"]
----
ApplicationContext context = new AnnotationConfigApplicationContext(DelegatingWeb
Reactive
Configuration.class); // (1)
ApplicationContext context = new AnnotationConfigApplicationContext(DelegatingWeb
Flux
Configuration.class); // (1)
HttpHandler handler = DispatcherHandler.toHttpHandler(context); // (2)
----
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录