From 2b9ac16eae49798d93a34285885e1be88041a56b Mon Sep 17 00:00:00 2001 From: kutmk Date: Wed, 14 Feb 2024 05:42:38 +0900 Subject: [PATCH] Enable AutoConfiguration of TestChannelBinderConfiguration --- .../stream/binder/test/TestChannelBinderConfiguration.java | 6 ++---- ...ngframework.boot.autoconfigure.AutoConfiguration.imports | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 core/spring-cloud-stream-test-binder/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports 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