spring-cloud-stream icon indicating copy to clipboard operation
spring-cloud-stream copied to clipboard

Make AbstractBinderTests more Spring-friendly

Open artembilan opened this issue 7 years ago • 0 comments

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.

artembilan avatar Jan 26 '18 19:01 artembilan