Upgrade to the latest SC-AWS and fix tests
This commit is contained in:
@@ -126,7 +126,8 @@ public class SqsMessageDrivenChannelAdapterTests {
|
||||
given(sqs.receiveMessage(new ReceiveMessageRequest("http://testQueue.amazonaws.com")
|
||||
.withAttributeNames("All")
|
||||
.withMessageAttributeNames("All")
|
||||
.withMaxNumberOfMessages(10)))
|
||||
.withMaxNumberOfMessages(10)
|
||||
.withWaitTimeSeconds(20)))
|
||||
.willReturn(new ReceiveMessageResult()
|
||||
.withMessages(new Message().withBody("messageContent"),
|
||||
new Message().withBody("messageContent2")))
|
||||
|
||||
@@ -48,7 +48,7 @@ import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.MessageHandler;
|
||||
import org.springframework.messaging.PollableChannel;
|
||||
import org.springframework.messaging.support.ChannelInterceptorAdapter;
|
||||
import org.springframework.messaging.support.ChannelInterceptor;
|
||||
import org.springframework.messaging.support.ErrorMessage;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
@@ -195,16 +195,15 @@ public class KinesisIntegrationTests {
|
||||
@Bean
|
||||
public PollableChannel errorChannel() {
|
||||
QueueChannel queueChannel = new QueueChannel();
|
||||
queueChannel.addInterceptor(new ChannelInterceptorAdapter() {
|
||||
queueChannel.addInterceptor(new ChannelInterceptor() {
|
||||
|
||||
@Override
|
||||
public void postSend(Message<?> message, MessageChannel channel, boolean sent) {
|
||||
super.postSend(message, channel, sent);
|
||||
|
||||
if (message instanceof ErrorMessage) {
|
||||
throw (RuntimeException) ((ErrorMessage) message).getPayload();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
return queueChannel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user