GH-1425 Added support for type-aware channels

Resolves #1425
This commit is contained in:
Oleg Zhurakousky
2018-10-23 12:07:58 +02:00
parent 43aaaf8263
commit 28990fe995
4 changed files with 61 additions and 6 deletions

View File

@@ -31,6 +31,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.binder.BinderHeaders;
import org.springframework.cloud.stream.converter.CompositeMessageConverterFactory;
import org.springframework.cloud.stream.messaging.DirectWithAttributesChannel;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.cloud.stream.test.binder.MessageCollector;
@@ -68,6 +69,14 @@ public class MessageChannelConfigurerTests {
@Autowired
private MessageCollector messageCollector;
@Test
public void testChannelTypes() throws Exception {
DirectWithAttributesChannel inputChannel = (DirectWithAttributesChannel) testSink.input();
DirectWithAttributesChannel outputChannel = (DirectWithAttributesChannel) testSource.output();
assertThat(inputChannel.getAttribute("type")).isEqualTo(Sink.INPUT);
assertThat(outputChannel.getAttribute("type")).isEqualTo(Source.OUTPUT);
}
@Test
public void testMessageConverterConfigurer() throws Exception {
final CountDownLatch latch = new CountDownLatch(1);