Polishing

This commit is contained in:
Juergen Hoeller
2016-08-26 17:29:16 +02:00
parent 52447efb97
commit e828be96f0
7 changed files with 54 additions and 67 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -199,6 +199,20 @@ public class MappingJackson2MessageConverterTests {
}
@JsonView(MyJacksonView1.class)
public JacksonViewBean jsonViewResponse() {
JacksonViewBean bean = new JacksonViewBean();
bean.setWithView1("with");
bean.setWithView2("with");
bean.setWithoutView("with");
return bean;
}
public void jsonViewPayload(@JsonView(MyJacksonView2.class) JacksonViewBean payload) {
}
public static class MyBean {
private String string;
@@ -262,9 +276,12 @@ public class MappingJackson2MessageConverterTests {
}
}
public interface MyJacksonView1 {};
public interface MyJacksonView2 {};
public static class JacksonViewBean {
@JsonView(MyJacksonView1.class)
@@ -300,16 +317,4 @@ public class MappingJackson2MessageConverterTests {
}
}
@JsonView(MyJacksonView1.class)
public JacksonViewBean jsonViewResponse() {
JacksonViewBean bean = new JacksonViewBean();
bean.setWithView1("with");
bean.setWithView2("with");
bean.setWithoutView("with");
return bean;
}
public void jsonViewPayload(@JsonView(MyJacksonView2.class) JacksonViewBean payload) {
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -66,7 +66,6 @@ public class GenericMessagingTemplateTests {
@Test
public void sendAndReceive() {
SubscribableChannel channel = new ExecutorSubscribableChannel(this.executor);
channel.subscribe(new MessageHandler() {
@Override
@@ -82,7 +81,6 @@ public class GenericMessagingTemplateTests {
@Test
public void sendAndReceiveTimeout() throws InterruptedException {
final AtomicReference<Throwable> failure = new AtomicReference<Throwable>();
final CountDownLatch latch = new CountDownLatch(1);
@@ -118,8 +116,9 @@ public class GenericMessagingTemplateTests {
assertNull(this.template.convertSendAndReceive(channel, "request", String.class));
assertTrue(latch.await(1000, TimeUnit.MILLISECONDS));
if (failure.get() != null) {
throw new AssertionError(failure.get());
Throwable ex = failure.get();
if (ex != null) {
throw new AssertionError(ex);
}
}
@@ -138,6 +137,7 @@ public class GenericMessagingTemplateTests {
assertFalse(accessor.isMutable());
}
private class TestDestinationResolver implements DestinationResolver<MessageChannel> {
@Override
@@ -145,4 +145,5 @@ public class GenericMessagingTemplateTests {
return messageChannel;
}
}
}