提交 4991b978 编写于 作者: S Sebastien Deleuze

Polish

上级 802a4c6d
......@@ -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 {}
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册