Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
4991b978
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,发现更多精彩内容 >>
提交
4991b978
编写于
9月 12, 2016
作者:
S
Sebastien Deleuze
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish
上级
802a4c6d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
12 deletion
+6
-12
spring-web/src/test/java/org/springframework/http/codec/json/Jackson2JsonDecoderTests.java
...ngframework/http/codec/json/Jackson2JsonDecoderTests.java
+5
-11
spring-web/src/test/java/org/springframework/http/codec/json/Jackson2JsonEncoderTests.java
...ngframework/http/codec/json/Jackson2JsonEncoderTests.java
+1
-1
未找到文件。
spring-web/src/test/java/org/springframework/http/codec/json/Jackson2JsonDecoderTests.java
浏览文件 @
4991b978
...
...
@@ -16,7 +16,6 @@
package
org.springframework.http.codec.json
;
import
java.lang.reflect.Method
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -64,12 +63,11 @@ public class Jackson2JsonDecoderTests extends AbstractDataBufferAllocatingTestCa
}
@Test
public
void
decodeToList
()
throws
Exception
{
public
void
decodeToList
()
{
Flux
<
DataBuffer
>
source
=
Flux
.
just
(
stringBuffer
(
"[{\"bar\":\"b1\",\"foo\":\"f1\"},{\"bar\":\"b2\",\"foo\":\"f2\"}]"
));
Method
method
=
getClass
().
getDeclaredMethod
(
"handle"
,
List
.
class
);
ResolvableType
elementType
=
ResolvableType
.
forMethodParameter
(
method
,
0
);
ResolvableType
elementType
=
ResolvableType
.
forClassWithGenerics
(
List
.
class
,
Pojo
.
class
);
Mono
<
Object
>
mono
=
new
Jackson2JsonDecoder
().
decodeToMono
(
source
,
elementType
,
null
,
Collections
.
emptyMap
());
...
...
@@ -78,7 +76,7 @@ public class Jackson2JsonDecoderTests extends AbstractDataBufferAllocatingTestCa
}
@Test
public
void
decodeToFlux
()
throws
Exception
{
public
void
decodeToFlux
()
{
Flux
<
DataBuffer
>
source
=
Flux
.
just
(
stringBuffer
(
"[{\"bar\":\"b1\",\"foo\":\"f1\"},{\"bar\":\"b2\",\"foo\":\"f2\"}]"
));
...
...
@@ -91,7 +89,7 @@ public class Jackson2JsonDecoderTests extends AbstractDataBufferAllocatingTestCa
}
@Test
public
void
jsonView
()
throws
Exception
{
public
void
jsonView
()
{
Flux
<
DataBuffer
>
source
=
Flux
.
just
(
stringBuffer
(
"{\"withView1\" : \"with\", \"withView2\" : \"with\", \"withoutView\" : \"without\"}"
));
ResolvableType
elementType
=
ResolvableType
.
forClass
(
JacksonViewBean
.
class
);
...
...
@@ -111,7 +109,7 @@ public class Jackson2JsonDecoderTests extends AbstractDataBufferAllocatingTestCa
}
@Test
public
void
decodeEmptyBodyToMono
()
throws
Exception
{
public
void
decodeEmptyBodyToMono
()
{
Flux
<
DataBuffer
>
source
=
Flux
.
empty
();
ResolvableType
elementType
=
ResolvableType
.
forClass
(
Pojo
.
class
);
Mono
<
Object
>
flux
=
new
Jackson2JsonDecoder
().
decodeToMono
(
source
,
elementType
,
...
...
@@ -124,10 +122,6 @@ public class Jackson2JsonDecoderTests extends AbstractDataBufferAllocatingTestCa
}
void
handle
(
List
<
Pojo
>
list
)
{
}
private
interface
MyJacksonView1
{}
private
interface
MyJacksonView2
{}
...
...
spring-web/src/test/java/org/springframework/http/codec/json/Jackson2JsonEncoderTests.java
浏览文件 @
4991b978
...
...
@@ -90,7 +90,7 @@ public class Jackson2JsonEncoderTests extends AbstractDataBufferAllocatingTestCa
}
@Test
public
void
jsonView
()
throws
Exception
{
public
void
jsonView
()
{
JacksonViewBean
bean
=
new
JacksonViewBean
();
bean
.
setWithView1
(
"with"
);
bean
.
setWithView2
(
"with"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录