Fix AMQP module according latest Spring AMQP
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
package org.springframework.integration.amqp.support;
|
||||
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException;
|
||||
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.rabbitmq.client.Channel;
|
||||
* Utility methods for messaging endpoints.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 5.1.3
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.integration.amqp.support;
|
||||
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException;
|
||||
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.rabbitmq.client.Channel;
|
||||
* Used for conversion errors when using manual acks.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 5.1.3
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.springframework.amqp.rabbit.junit.RabbitAvailable;
|
||||
import org.springframework.amqp.rabbit.junit.RabbitAvailableCondition;
|
||||
import org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer;
|
||||
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
|
||||
import org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException;
|
||||
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
||||
import org.springframework.amqp.support.converter.MessageConversionException;
|
||||
import org.springframework.amqp.support.converter.SimpleMessageConverter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -168,7 +168,7 @@ public class AmqpTests {
|
||||
private MessageChannel amqpAsyncOutboundFlowInput;
|
||||
|
||||
@Test
|
||||
public void testAmqpAsyncOutboundGatewayFlow() throws Exception {
|
||||
public void testAmqpAsyncOutboundGatewayFlow() {
|
||||
QueueChannel replyChannel = new QueueChannel();
|
||||
this.amqpAsyncOutboundFlowInput.send(MessageBuilder.withPayload("async gateway")
|
||||
.setReplyChannel(replyChannel)
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer;
|
||||
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
|
||||
import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
|
||||
import org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException;
|
||||
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
||||
import org.springframework.amqp.support.AmqpHeaders;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
import org.springframework.amqp.support.converter.MessageConversionException;
|
||||
@@ -100,7 +100,7 @@ public class InboundEndpointTests {
|
||||
Object payload = new Foo("bar1");
|
||||
|
||||
Transformer objectToJsonTransformer = new ObjectToJsonTransformer();
|
||||
Message<?> jsonMessage = objectToJsonTransformer.transform(new GenericMessage<Object>(payload));
|
||||
Message<?> jsonMessage = objectToJsonTransformer.transform(new GenericMessage<>(payload));
|
||||
|
||||
MessageProperties amqpMessageProperties = new MessageProperties();
|
||||
amqpMessageProperties.setDeliveryTag(123L);
|
||||
@@ -343,7 +343,8 @@ public class InboundEndpointTests {
|
||||
assertThat(payload.getMessage()).contains("Dispatcher has no");
|
||||
assertThat(StaticMessageHeaderAccessor.getDeliveryAttempt(payload.getFailedMessage()).get()).isEqualTo(3);
|
||||
org.springframework.amqp.core.Message amqpMessage = errorMessage.getHeaders()
|
||||
.get(AmqpMessageHeaderErrorMessageStrategy.AMQP_RAW_MESSAGE, org.springframework.amqp.core.Message.class);
|
||||
.get(AmqpMessageHeaderErrorMessageStrategy.AMQP_RAW_MESSAGE,
|
||||
org.springframework.amqp.core.Message.class);
|
||||
assertThat(amqpMessage).isNotNull();
|
||||
assertThat(errors.receive(0)).isNull();
|
||||
}
|
||||
@@ -370,7 +371,8 @@ public class InboundEndpointTests {
|
||||
assertThat(payload.getMessage()).contains("Dispatcher has no");
|
||||
assertThat(StaticMessageHeaderAccessor.getDeliveryAttempt(payload.getFailedMessage()).get()).isEqualTo(3);
|
||||
org.springframework.amqp.core.Message amqpMessage = errorMessage.getHeaders()
|
||||
.get(AmqpMessageHeaderErrorMessageStrategy.AMQP_RAW_MESSAGE, org.springframework.amqp.core.Message.class);
|
||||
.get(AmqpMessageHeaderErrorMessageStrategy.AMQP_RAW_MESSAGE,
|
||||
org.springframework.amqp.core.Message.class);
|
||||
assertThat(amqpMessage).isNotNull();
|
||||
assertThat(errors.receive(0)).isNull();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user