INT-3470: SF 4.1 Compatibility #2

JIRA: https://jira.spring.io/browse/INT-3470

* Apply the last `ChannelInterceptor` changes - just `extends ChannelInterceptorAdapter`
* Change some tests to check content according to the new changes to the `GenericMessage#toString()`

**Cherry-pick to 4.0.x**
This commit is contained in:
Artem Bilan
2014-07-14 14:52:36 +03:00
committed by Gary Russell
parent e8898821ae
commit f0eeb3b2b9
6 changed files with 16 additions and 14 deletions

View File

@@ -55,8 +55,8 @@ public class AnnotationAggregatorTests {
@SuppressWarnings("unchecked")
Message<String> result = (Message<String>) output.receive();
String payload = result.getPayload();
assertTrue("Wrong payload: "+payload, payload.contains("Payload String content=a"));
assertTrue("Wrong payload: "+payload, payload.contains("Payload String content=b"));
assertTrue("Wrong payload: "+payload, payload.matches(".*Payload.*?=a.*"));
assertTrue("Wrong payload: "+payload, payload.matches(".*Payload.*?=b.*"));
}
@SuppressWarnings("unused")

View File

@@ -30,11 +30,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.core.Ordered;
import org.springframework.integration.channel.AbstractMessageChannel;
import org.springframework.integration.channel.ChannelInterceptorAware;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.ChannelInterceptor;
import org.springframework.messaging.support.ChannelInterceptorAdapter;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -127,7 +127,7 @@ public class GlobalChannelInterceptorTests {
}
public static class SampleInterceptor implements ChannelInterceptor {
public static class SampleInterceptor extends ChannelInterceptorAdapter {
private String testIdentifier;

View File

@@ -15,10 +15,8 @@
*/
package org.springframework.integration.channel.interceptor;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.util.List;
@@ -31,6 +29,7 @@ import org.springframework.integration.channel.ChannelInterceptorAware;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.ChannelInterceptor;
import org.springframework.messaging.support.ChannelInterceptorAdapter;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -69,7 +68,7 @@ public class ImplicitConsumerChannelTests {
assertThat(bazInterceptors.get(1), anyOf(instanceOf(WireTap.class), instanceOf(Interceptor1.class)));
}
public static class Interceptor1 implements ChannelInterceptor, VetoCapableInterceptor {
public static class Interceptor1 extends ChannelInterceptorAdapter implements VetoCapableInterceptor {
private MessageChannel channel;
@@ -107,7 +106,7 @@ public class ImplicitConsumerChannelTests {
}
public static class Interceptor2 implements ChannelInterceptor, VetoCapableInterceptor {
public static class Interceptor2 extends ChannelInterceptorAdapter implements VetoCapableInterceptor {
private MessageChannel channel;