diff --git a/core/spring-cloud-stream-test-binder/src/main/java/org/springframework/cloud/stream/binder/test/TestChannelBinderConfiguration.java b/core/spring-cloud-stream-test-binder/src/main/java/org/springframework/cloud/stream/binder/test/TestChannelBinderConfiguration.java index a62e7a1234..ef224de545 100644 --- a/core/spring-cloud-stream-test-binder/src/main/java/org/springframework/cloud/stream/binder/test/TestChannelBinderConfiguration.java +++ b/core/spring-cloud-stream-test-binder/src/main/java/org/springframework/cloud/stream/binder/test/TestChannelBinderConfiguration.java @@ -20,7 +20,7 @@ import java.util.Arrays; import java.util.List; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.cloud.stream.binder.Binder; import org.springframework.cloud.stream.binder.ConsumerProperties; @@ -28,7 +28,6 @@ import org.springframework.cloud.stream.config.BinderFactoryAutoConfiguration; import org.springframework.cloud.stream.config.BindingServiceConfiguration; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.integration.config.EnableIntegration; @@ -42,8 +41,7 @@ * @author David Turanski * @see TestChannelBinder */ -@Configuration -@ConditionalOnMissingBean(Binder.class) +@AutoConfiguration @Import(BinderFactoryAutoConfiguration.class) @EnableIntegration public class TestChannelBinderConfiguration { diff --git a/core/spring-cloud-stream-test-binder/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/core/spring-cloud-stream-test-binder/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000000..6182334ffd --- /dev/null +++ b/core/spring-cloud-stream-test-binder/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration