spring-cloud-stream
spring-cloud-stream copied to clipboard
Make AbstractBinderTests more Spring-friendly
Right now AbstractBinderTests doesn't allow to inject external ApplicationContext for internal components to test.
For example I would like to have something like:
@EnableBinding
static class Config {
@Bean
public PartitionTestSupport partitionSupport() {
return new PartitionTestSupport();
}
}
and use it from the:
public KinesisTestBinder(AmazonKinesisAsync amazonKinesis,
KinesisBinderConfigurationProperties kinesisBinderConfigurationProperties) {
this.applicationContext = new AnnotationConfigApplicationContext(Config.class);
Then this application context should be available in all support methods in the AbstractBinderTests for example that partitionSupport bean should be available from the createBindableChannel() to properly bind all the necessary Spring Cloud Stream infrastructure into the channel we expect.