use of org.springframework.cloud.stream.converter.CompositeMessageConverterFactory in project spring-cloud-stream by spring-cloud.
the class MessageConverterConfigurerTests method testConfigureOutputChannelWithBadContentType.
// @Test
public void testConfigureOutputChannelWithBadContentType() {
BindingServiceProperties props = new BindingServiceProperties();
BindingProperties bindingProps = new BindingProperties();
bindingProps.setContentType("application/json");
props.setBindings(Collections.singletonMap("foo", bindingProps));
CompositeMessageConverterFactory converterFactory = new CompositeMessageConverterFactory(Collections.<MessageConverter>emptyList(), null);
MessageConverterConfigurer configurer = new MessageConverterConfigurer(props, converterFactory);
QueueChannel out = new QueueChannel();
configurer.configureOutputChannel(out, "foo");
out.send(new GenericMessage<Foo>(new Foo(), Collections.<String, Object>singletonMap(MessageHeaders.CONTENT_TYPE, "bad/ct")));
Message<?> received = out.receive(0);
assertThat(received).isNotNull();
assertThat(received.getPayload()).isInstanceOf(Foo.class);
}
Aggregations