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:
committed by
Gary Russell
parent
e8898821ae
commit
f0eeb3b2b9
@@ -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")
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user