use of org.springframework.amqp.support.converter.MessagingMessageConverter in project spring-amqp by spring-projects.
the class RabbitMessagingTemplateTests method verifyConverter.
@Test
public void verifyConverter() {
RabbitTemplate template = new RabbitTemplate(mock(ConnectionFactory.class));
RabbitMessagingTemplate rmt = new RabbitMessagingTemplate(template);
rmt.afterPropertiesSet();
assertThat(TestUtils.getPropertyValue(rmt, "amqpMessageConverter.payloadConverter")).isSameAs(template.getMessageConverter());
rmt = new RabbitMessagingTemplate(template);
MessagingMessageConverter amqpMessageConverter = new MessagingMessageConverter();
MessageConverter payloadConverter = mock(MessageConverter.class);
amqpMessageConverter.setPayloadConverter(payloadConverter);
rmt.setAmqpMessageConverter(amqpMessageConverter);
rmt.afterPropertiesSet();
assertThat(TestUtils.getPropertyValue(rmt, "amqpMessageConverter.payloadConverter")).isSameAs(payloadConverter);
}
use of org.springframework.amqp.support.converter.MessagingMessageConverter in project spring-cloud-contract by spring-cloud.
the class ContractVerifierHelper method convert.
@Override
protected ContractVerifierMessage convert(Message message) {
MessagingMessageConverter messageConverter = new MessagingMessageConverter(this.messageConverter, new SimpleAmqpHeaderMapper());
org.springframework.messaging.Message<?> messagingMessage;
messagingMessage = (org.springframework.messaging.Message<?>) messageConverter.fromMessage(message);
return new ContractVerifierMessage(messagingMessage.getPayload(), messagingMessage.getHeaders());
}
Aggregations