spring-cloud / spring-cloud/spring-cloud-stream

Make AbstractBinderTests more Spring-friendly

Open
#1,196 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
646
Avg merge
2d 3h
Merged PRs (30d)
8

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading AbstractBinderTests and the KinesisTestBinder constructor, then trace createBindableChannel() and the existing application-context setup shown in the issue. The change is complete when an externally supplied Config context, including its partitionSupport bean, is available to the AbstractBinderTests support methods and the expected binding infrastructure is created.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.