use of org.springframework.cloud.stream.binding.BindingTargetFactory in project spring-cloud-stream by spring-cloud.
the class AggregationTest method testModuleAggregationUsingSharedChannelRegistry.
@Test
public void testModuleAggregationUsingSharedChannelRegistry() {
// test backward compatibility
aggregatedApplicationContext = new AggregateApplicationBuilder(MockBinderRegistryConfiguration.class, "--server.port=0").web(false).from(TestSource.class).to(TestProcessor.class).run();
SharedBindingTargetRegistry sharedChannelRegistry = aggregatedApplicationContext.getBean(SharedBindingTargetRegistry.class);
BindingTargetFactory channelFactory = aggregatedApplicationContext.getBean(SubscribableChannelBindingTargetFactory.class);
assertThat(channelFactory).isNotNull();
assertThat(sharedChannelRegistry.getAll().keySet()).hasSize(2);
aggregatedApplicationContext.close();
}
use of org.springframework.cloud.stream.binding.BindingTargetFactory in project spring-cloud-stream by spring-cloud.
the class AggregationTest method aggregation.
@Test
public void aggregation() {
aggregatedApplicationContext = new AggregateApplicationBuilder(MockBinderRegistryConfiguration.class, "--server.port=0", "--debug=true").web(false).from(TestSource.class).to(TestProcessor.class).run();
SharedBindingTargetRegistry sharedBindingTargetRegistry = aggregatedApplicationContext.getBean(SharedBindingTargetRegistry.class);
BindingTargetFactory channelFactory = aggregatedApplicationContext.getBean(SubscribableChannelBindingTargetFactory.class);
assertThat(channelFactory).isNotNull();
assertThat(sharedBindingTargetRegistry.getAll().keySet()).hasSize(2);
aggregatedApplicationContext.close();
}
use of org.springframework.cloud.stream.binding.BindingTargetFactory in project spring-cloud-stream by spring-cloud.
the class AggregationTest method testNamespaces.
@Test
public void testNamespaces() {
aggregatedApplicationContext = new AggregateApplicationBuilder(MockBinderRegistryConfiguration.class, "--server.port=0").web(false).from(TestSource.class).namespace("foo").to(TestProcessor.class).namespace("bar").run();
SharedBindingTargetRegistry sharedChannelRegistry = aggregatedApplicationContext.getBean(SharedBindingTargetRegistry.class);
BindingTargetFactory channelFactory = aggregatedApplicationContext.getBean(SubscribableChannelBindingTargetFactory.class);
MessageChannel fooOutput = sharedChannelRegistry.get("foo.output", MessageChannel.class);
assertThat(fooOutput).isNotNull();
Object barInput = sharedChannelRegistry.get("bar.input", MessageChannel.class);
assertThat(barInput).isNotNull();
assertThat(channelFactory).isNotNull();
assertThat(sharedChannelRegistry.getAll().keySet()).hasSize(2);
aggregatedApplicationContext.close();
}
Aggregations