INT-1227 removed the protected getOutputChannel() method from AbstractReplyProducingMessageHandler. BridgeHandler no longer asserts an output channel in order to throw an Exception. Instead, a ChannelResolutionException is thrown in the normal place for a missing outputChannel property or replyChannel header in the AbstractReplyProducingMessageHandler.

This commit is contained in:
Mark Fisher
2010-08-30 21:29:16 +00:00
parent c44355c5c9
commit 8967d7eb51
3 changed files with 8 additions and 23 deletions

View File

@@ -24,8 +24,8 @@ import org.hamcrest.Matcher;
import org.junit.Test;
import org.springframework.integration.Message;
import org.springframework.integration.MessageHandlingException;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.core.ChannelResolutionException;
import org.springframework.integration.core.GenericMessage;
import org.springframework.integration.core.MessageBuilder;
import org.springframework.integration.core.PollableChannel;
@@ -55,18 +55,17 @@ public class BridgeHandlerTests {
assertThat(reply, sameExceptImmutableHeaders(request));
}
@Test(expected = MessageHandlingException.class)
@Test(expected = ChannelResolutionException.class)
public void missingOutputChannelVerifiedAtRuntime() {
Message<?> request = new GenericMessage<String>("test");
handler.handleMessage(request);
}
@SuppressWarnings("unchecked")
@Test(timeout=1000)
public void missingOutputChannelAllowedForReplyChannelMessages() throws Exception {
PollableChannel replyChannel = new QueueChannel();
Message request = MessageBuilder.withPayload("tst").setReplyChannel(replyChannel ).build();
handler.handleMessage(request );
Message<String> request = MessageBuilder.withPayload("tst").setReplyChannel(replyChannel ).build();
handler.handleMessage(request);
assertThat(replyChannel.receive(), sameExceptImmutableHeaders(request));
}