Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
5497416c
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,发现更多精彩内容 >>
提交
5497416c
编写于
5月 08, 2017
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
f25c6ba9
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
5 addition
and
14 deletion
+5
-14
spring-web/src/test/java/org/springframework/http/converter/xml/MappingJackson2XmlHttpMessageConverterTests.java
...rter/xml/MappingJackson2XmlHttpMessageConverterTests.java
+1
-12
spring-webflux/src/test/java/org/springframework/web/reactive/function/server/RouterFunctionTests.java
...ork/web/reactive/function/server/RouterFunctionTests.java
+4
-2
未找到文件。
spring-web/src/test/java/org/springframework/http/converter/xml/MappingJackson2XmlHttpMessageConverterTests.java
浏览文件 @
5497416c
...
...
@@ -17,7 +17,6 @@
package
org.springframework.http.converter.xml
;
import
java.io.IOException
;
import
java.lang.reflect.Method
;
import
java.nio.charset.StandardCharsets
;
import
com.fasterxml.jackson.annotation.JsonView
;
...
...
@@ -27,11 +26,9 @@ import org.junit.Test;
import
org.junit.rules.ExpectedException
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.http.HttpOutputMessage
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MockHttpInputMessage
;
import
org.springframework.http.MockHttpOutputMessage
;
import
org.springframework.http.converter.AbstractHttpMessageConverter
;
import
org.springframework.http.converter.json.MappingJacksonValue
;
import
static
org
.
hamcrest
.
CoreMatchers
.*;
...
...
@@ -128,7 +125,7 @@ public class MappingJackson2XmlHttpMessageConverterTests {
MappingJacksonValue
jacksonValue
=
new
MappingJacksonValue
(
bean
);
jacksonValue
.
setSerializationView
(
MyJacksonView1
.
class
);
this
.
writeInternal
(
jacksonValue
,
outputMessage
);
this
.
converter
.
write
(
jacksonValue
,
null
,
outputMessage
);
String
result
=
outputMessage
.
getBodyAsString
(
StandardCharsets
.
UTF_8
);
assertThat
(
result
,
containsString
(
"<withView1>with</withView1>"
));
...
...
@@ -185,14 +182,6 @@ public class MappingJackson2XmlHttpMessageConverterTests {
}
private
void
writeInternal
(
Object
object
,
HttpOutputMessage
outputMessage
)
throws
Exception
{
Method
method
=
AbstractHttpMessageConverter
.
class
.
getDeclaredMethod
(
"writeInternal"
,
Object
.
class
,
HttpOutputMessage
.
class
);
method
.
setAccessible
(
true
);
method
.
invoke
(
this
.
converter
,
object
,
outputMessage
);
}
public
static
class
MyBean
{
private
String
string
;
...
...
spring-webflux/src/test/java/org/springframework/web/reactive/function/server/RouterFunctionTests.java
浏览文件 @
5497416c
...
...
@@ -87,8 +87,10 @@ public class RouterFunctionTests {
@Test
public
void
filter
()
throws
Exception
{
Mono
<
String
>
stringMono
=
Mono
.
just
(
"42"
);
HandlerFunction
<
EntityResponse
<
Mono
<
String
>>>
handlerFunction
=
request
->
EntityResponse
.
fromPublisher
(
stringMono
,
String
.
class
).
build
();
RouterFunction
<
EntityResponse
<
Mono
<
String
>>>
routerFunction
=
request
->
Mono
.
just
(
handlerFunction
);
HandlerFunction
<
EntityResponse
<
Mono
<
String
>>>
handlerFunction
=
request
->
EntityResponse
.
fromPublisher
(
stringMono
,
String
.
class
).
build
();
RouterFunction
<
EntityResponse
<
Mono
<
String
>>>
routerFunction
=
request
->
Mono
.
just
(
handlerFunction
);
HandlerFilterFunction
<
EntityResponse
<
Mono
<
String
>>,
EntityResponse
<
Mono
<
Integer
>>>
filterFunction
=
(
request
,
next
)
->
next
.
handle
(
request
).
flatMap
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录