Spring Boot 2.1 upgrade related changes
* Instead of redefining `BinderTypeRegistry` as a bean in several tests, properly use spring.binders to define mock binders and then choose a default binder in tests in case of multiple binders in same spring.binders file. * Remove `BindingServiceConfiguration` in `EnableBinding` and introduce it as a proper Spring Boot autoconfiguration class. Added `BindingServiceConfiguration` to spring.factories. * Move `BinderFactory` bean into `BindingServiceConfiguration` and add `ConditionalOnMissingBean` on it so that downstream users can define new `BinderFactory` beans as part of autoconfiguration. * Remove `ConditionalOnMissingBean` from the `BinderTypeRegistry` bean in `BinderFactoryConfiguration` as we don't expect this bean to be overridden. * Remove previously added property `spring.main.allow-bean-definition-overriding` in several tests. * Since web/actuator is optional now, remove unncecessarily setting server.port to `0` in tests * Ensure that `BindersHealthIndicatorAutoConfiguration` is autoconfigured after `BindingServiceConfiguration` so that it has a `BinderFactory` available. * Remove redefining `ServerController` bean in `SchemaServerConfiguration` as this is already created through component scanning and causing the bean overriding exceptions. * Tests cleanup and polishing. Resolves #1429, #1430
This commit is contained in:
@@ -41,8 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = { ContentTypeOutboundSourceTests.TestSource.class },
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest(classes = { ContentTypeOutboundSourceTests.TestSource.class })
|
||||
public class ContentTypeOutboundSourceTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -44,8 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = CustomHeaderPropagationTests.HeaderPropagationProcessor.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE,
|
||||
properties = {"spring.cloud.stream.integration.messageHandlerNotPropagatedHeaders=bar,contentType",
|
||||
"--spring.main.allow-bean-definition-overriding=true"})
|
||||
properties = {"spring.cloud.stream.integration.messageHandlerNotPropagatedHeaders=bar,contentType"})
|
||||
public class CustomHeaderPropagationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -51,8 +51,7 @@ import static org.hamcrest.Matchers.notNullValue;
|
||||
* @author Janne Valkealahti
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = CustomMessageConverterTests.TestSource.class,
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest(classes = CustomMessageConverterTests.TestSource.class)
|
||||
public class CustomMessageConverterTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -43,8 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = DefaultHeaderPropagationTests.HeaderPropagationProcessor.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE,
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
public class DefaultHeaderPropagationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -37,15 +37,13 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
|
||||
/**
|
||||
* @author Marius Bogoevici
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = DefaultHeaderPropagationWithApplicationProvidedHeaderTests.HeaderPropagationProcessor.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE,
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
public class DefaultHeaderPropagationWithApplicationProvidedHeaderTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -43,8 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = DeserializeJSONToJavaTypeTests.FooProcessor.class,
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest(classes = DeserializeJSONToJavaTypeTests.FooProcessor.class)
|
||||
public class DeserializeJSONToJavaTypeTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -45,8 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = InboundJsonToTupleConversionTest.FooProcessor.class,
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest(classes = InboundJsonToTupleConversionTest.FooProcessor.class)
|
||||
public class InboundJsonToTupleConversionTest {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -43,8 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = { LegacyContentTypeTests.LegacyTestSink.class},
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest(classes = { LegacyContentTypeTests.LegacyTestSink.class})
|
||||
public class LegacyContentTypeTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -53,8 +53,7 @@ import static org.junit.Assert.assertNull;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = { MessageChannelConfigurerTests.TestSink.class,
|
||||
MessageChannelConfigurerTests.TestSource.class, SpelExpressionConverterConfiguration.class},
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
MessageChannelConfigurerTests.TestSource.class, SpelExpressionConverterConfiguration.class})
|
||||
public class MessageChannelConfigurerTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -41,8 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Soby Chacko
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = { MessageChannelWithNativeDecodingTests.NativeDecodingSink.class},
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest(classes = { MessageChannelWithNativeDecodingTests.NativeDecodingSink.class})
|
||||
public class MessageChannelWithNativeDecodingTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -39,8 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Soby Chacko
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = { MessageChannelWithNativeEncodingTests.NativeEncodingSource.class},
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest(classes = { MessageChannelWithNativeEncodingTests.NativeEncodingSource.class})
|
||||
public class MessageChannelWithNativeEncodingTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -50,11 +49,6 @@ import static org.springframework.cloud.stream.binding.StreamListenerErrorMessag
|
||||
*/
|
||||
public class StreamListenerAnnotatedMethodArgumentsTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testAnnotatedArguments() throws Exception {
|
||||
|
||||
@@ -23,10 +23,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
@@ -35,6 +33,7 @@ import org.springframework.cloud.stream.binding.StreamListenerAnnotationBeanPost
|
||||
import org.springframework.cloud.stream.messaging.Sink;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.messaging.handler.annotation.Payload;
|
||||
@@ -47,11 +46,6 @@ import static org.springframework.cloud.stream.config.BindingServiceConfiguratio
|
||||
*/
|
||||
public class StreamListenerAnnotationBeanPostProcessorOverrideTest {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testOverrideStreamListenerAnnotationBeanPostProcessor() throws Exception {
|
||||
@@ -74,6 +68,7 @@ public class StreamListenerAnnotationBeanPostProcessorOverrideTest {
|
||||
context.close();
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableBinding(Sink.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class TestPojoWithAnnotatedArguments {
|
||||
@@ -84,7 +79,7 @@ public class StreamListenerAnnotationBeanPostProcessorOverrideTest {
|
||||
* Overrides the default {@link StreamListenerAnnotationBeanPostProcessor}.
|
||||
*/
|
||||
@Bean(name = STREAM_LISTENER_ANNOTATION_BEAN_POST_PROCESSOR_NAME)
|
||||
public static BeanPostProcessor streamListenerAnnotationBeanPostProcessor() {
|
||||
public static StreamListenerAnnotationBeanPostProcessor streamListenerAnnotationBeanPostProcessor() {
|
||||
return new StreamListenerAnnotationBeanPostProcessor() {
|
||||
@Override
|
||||
protected StreamListener postProcessAnnotation(StreamListener originalAnnotation,
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -75,11 +74,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
public class StreamListenerAsMetaAnnotationTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomAnnotation() {
|
||||
ConfigurableApplicationContext context = SpringApplication.run(TestPojoWithCustomAnnotatedArguments.class,
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.UUID;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -41,11 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
public class StreamListenerContentTypeConversionTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testContentTypeConversion() throws Exception {
|
||||
ConfigurableApplicationContext context = SpringApplication.run(TestSinkWithContentTypeConversion.class,
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.cloud.stream.config;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
@@ -40,11 +39,6 @@ import static org.junit.Assert.fail;
|
||||
*/
|
||||
public class StreamListenerDuplicateMappingTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testMultipleMappingsWithReturnValue() {
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -58,11 +57,6 @@ public class StreamListenerHandlerBeanTests {
|
||||
|
||||
private Class<?> configClass;
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
public StreamListenerHandlerBeanTests(Class<?> configClass) {
|
||||
this.configClass = configClass;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.cloud.stream.config;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
@@ -68,11 +67,6 @@ import static org.springframework.cloud.stream.binding.StreamListenerErrorMessag
|
||||
*/
|
||||
public class StreamListenerHandlerMethodTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidInputOnMethod() throws Exception {
|
||||
try {
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -57,11 +56,6 @@ public class StreamListenerMessageArgumentTests {
|
||||
this.configClass = configClass;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Parameterized.Parameters
|
||||
public static Collection<?> InputConfigs() {
|
||||
return Arrays.asList(new Class[] { TestPojoWithMessageArgument1.class, TestPojoWithMessageArgument2.class });
|
||||
|
||||
@@ -41,7 +41,7 @@ import static org.mockito.Mockito.verify;
|
||||
* @author Soby Chacko
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest
|
||||
public class StreamListenerMethodRegisteredOnlyOnceTest {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -67,11 +66,6 @@ public class StreamListenerMethodReturnWithConversionTests extends Suite {
|
||||
super(klass, builder);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
public static class TestReturnConversion {
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ import static org.mockito.Mockito.verify;
|
||||
* @author Soby Chacko
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest
|
||||
public class StreamListenerMethodSetupOrchestratorTests {
|
||||
|
||||
@SpyBean
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -58,11 +57,6 @@ public class StreamListenerMethodWithReturnMessageTests {
|
||||
this.configClass = configClass;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Parameterized.Parameters
|
||||
public static Collection<?> InputConfigs() {
|
||||
return Arrays.asList(new Class[] { TestPojoWithMessageReturn1.class, TestPojoWithMessageReturn2.class });
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -57,11 +56,6 @@ public class StreamListenerMethodWithReturnValueTests {
|
||||
this.configClass = configClass;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Parameterized.Parameters
|
||||
public static Collection<?> InputConfigs() {
|
||||
return Arrays.asList(new Class[] { TestStringProcessor1.class, TestStringProcessor2.class });
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.cloud.stream.config;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -50,11 +49,6 @@ import static org.springframework.cloud.stream.binding.StreamListenerErrorMessag
|
||||
*/
|
||||
public class StreamListenerWithAnnotatedInputOutputArgsTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInputOutputArgs() throws Exception {
|
||||
ConfigurableApplicationContext context = SpringApplication.run(TestInputOutputArgs.class, "--server.port=0", "--spring.cloud.stream.bindings.output.contentType=text/plain", "--spring.jmx.enabled=false");
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -43,11 +42,6 @@ import static org.assertj.core.api.Assertions.fail;
|
||||
*/
|
||||
public class StreamListenerWithConditionsTest {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnnotatedArgumentsWithConditionalClass() throws Exception {
|
||||
ConfigurableApplicationContext context = SpringApplication.run(TestPojoWithAnnotatedArguments.class,
|
||||
|
||||
@@ -45,8 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = TextPlainConversionTest.FooProcessor.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE,
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
public class TextPlainConversionTest {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -48,8 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = TextPlainToJsonConversionTest.FooProcessor.class,
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE,
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"}
|
||||
webEnvironment = SpringBootTest.WebEnvironment.NONE
|
||||
)
|
||||
public class TextPlainToJsonConversionTest {
|
||||
|
||||
|
||||
@@ -19,19 +19,20 @@ package org.springframework.cloud.stream.config.aggregate;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.cloud.stream.aggregate.AggregateApplicationBuilder;
|
||||
import org.springframework.cloud.stream.binder.BinderFactory;
|
||||
import org.springframework.cloud.stream.config.aggregate.processor.TestProcessor;
|
||||
import org.springframework.cloud.stream.config.aggregate.source.TestSource;
|
||||
import org.springframework.cloud.stream.test.binder.TestSupportBinder;
|
||||
import org.springframework.cloud.stream.test.binder.TestSupportBinderAutoConfiguration;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
@@ -41,19 +42,14 @@ import static org.hamcrest.Matchers.notNullValue;
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@DirtiesContext
|
||||
public class AggregateApplicationTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("server.port", "0");
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testAggregateApplication() throws Exception {
|
||||
ConfigurableApplicationContext context = new AggregateApplicationBuilder(
|
||||
TestSupportBinderAutoConfiguration.class).web(false).from(TestSource.class).to(TestProcessor.class).run();
|
||||
FooConfig.class).web(false).from(TestSource.class).to(TestProcessor.class).run();
|
||||
TestSupportBinder testSupportBinder = (TestSupportBinder) context.getBean(BinderFactory.class).getBinder(null,
|
||||
MessageChannel.class);
|
||||
MessageChannel processorOutput = testSupportBinder.getChannelForName("output");
|
||||
@@ -62,4 +58,10 @@ public class AggregateApplicationTests {
|
||||
Assert.assertThat(received, notNullValue());
|
||||
Assert.assertTrue(received.getPayload().endsWith("processed"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
static class FooConfig{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import com.esotericsoftware.kryo.Kryo;
|
||||
import com.esotericsoftware.kryo.io.Output;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -60,11 +58,6 @@ public class ContentTypeTests {
|
||||
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSendWithDefaultContentType() throws Exception {
|
||||
try (ConfigurableApplicationContext context = SpringApplication.run(
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -55,11 +54,6 @@ public class StreamListenerReactiveInputOutputArgsTests {
|
||||
this.configClass = configClass;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Parameterized.Parameters
|
||||
public static Collection<?> InputConfigs() {
|
||||
return Collections.singletonList(ReactorTestInputOutputArgs.class);
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.cloud.stream.reactive;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
@@ -38,11 +37,6 @@ import static org.springframework.cloud.stream.binding.StreamListenerErrorMessag
|
||||
*/
|
||||
public class StreamListenerReactiveMethodTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReactiveInvalidInputValueWithOutputMethodParameters() {
|
||||
try {
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -56,11 +55,6 @@ public class StreamListenerReactiveMethodWithReturnTypeTests {
|
||||
this.configClass = configClass;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Parameterized.Parameters
|
||||
public static Collection<?> InputConfigs() {
|
||||
return Arrays.asList(ReactorTestReturn1.class, ReactorTestReturn2.class, ReactorTestReturn3.class,
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -56,11 +55,6 @@ public class StreamListenerReactiveReturnWithFailureTests {
|
||||
this.configClass = configClass;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Parameterized.Parameters
|
||||
public static Collection<?> InputConfigs() {
|
||||
return Arrays.asList(ReactorTestReturnWithFailure1.class, ReactorTestReturnWithFailure2.class,
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -62,11 +61,6 @@ public class StreamListenerReactiveReturnWithMessageTests {
|
||||
ReactorTestReturnWithMessage3.class, ReactorTestReturnWithMessage4.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static void sendMessageAndValidate(ConfigurableApplicationContext context) throws InterruptedException {
|
||||
Processor processor = context.getBean(Processor.class);
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScanPackages;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.cloud.stream.schema.server.controllers.ServerController;
|
||||
import org.springframework.cloud.stream.schema.server.model.Schema;
|
||||
import org.springframework.cloud.stream.schema.server.repository.SchemaRepository;
|
||||
import org.springframework.cloud.stream.schema.server.support.AvroSchemaValidator;
|
||||
@@ -37,6 +36,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
/**
|
||||
* @author Vinicius Carvalho
|
||||
* @author Soby Chacko
|
||||
*/
|
||||
@Configuration
|
||||
@EnableJpaRepositories(basePackageClasses = SchemaRepository.class)
|
||||
@@ -57,12 +57,6 @@ public class SchemaServerConfiguration {
|
||||
};
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ServerController serverController(SchemaRepository repository,
|
||||
SchemaServerProperties schemeServerProperties) {
|
||||
return new ServerController(repository, schemaValidators(), schemeServerProperties);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Map<String, SchemaValidator> schemaValidators() {
|
||||
Map<String, SchemaValidator> validatorMap = new HashMap<>();
|
||||
|
||||
@@ -44,8 +44,7 @@ import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER
|
||||
* @author Ilayaperumal Gopinathan
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT,
|
||||
properties = {"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
@DirtiesContext(classMode = AFTER_EACH_TEST_METHOD)
|
||||
public class SchemaRegistryServerAvroTests {
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ public class AvroMessageConverterSerializationTests {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
System.setProperty("--spring.main.allow-bean-definition-overriding", "true");
|
||||
schemaRegistryServerContext = SpringApplication
|
||||
.run(SchemaRegistryServerApplication.class);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -53,11 +52,6 @@ public class AvroSchemaMessageConverterTests {
|
||||
|
||||
static StubSchemaRegistryClient stubSchemaRegistryClient = new StubSchemaRegistryClient();
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
System.setProperty("--spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSendMessageWithLocation() throws Exception {
|
||||
ConfigurableApplicationContext sourceContext = SpringApplication.run(AvroSourceApplication.class,
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
@@ -57,11 +56,6 @@ public class AvroSchemaRegistryClientMessageConverterTests {
|
||||
|
||||
static SchemaRegistryClient stubSchemaRegistryClient = new StubSchemaRegistryClient();
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
System.setProperty("--spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSendMessage() throws Exception {
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -46,11 +45,6 @@ public class AvroStubSchemaRegistryClientMessageConverterTests {
|
||||
|
||||
static SchemaRegistryClient stubSchemaRegistryClient = new StubSchemaRegistryClient();
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
System.setProperty("--spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSendMessage() throws Exception {
|
||||
ConfigurableApplicationContext sourceContext = SpringApplication.run(AvroSourceApplication.class,
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.cloud.schema.avro;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -43,11 +42,6 @@ public class SubjectNamingStrategyTest {
|
||||
|
||||
static StubSchemaRegistryClient stubSchemaRegistryClient = new StubSchemaRegistryClient();
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
System.setProperty("--spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomNamingStrategy() throws Exception {
|
||||
ConfigurableApplicationContext sourceContext = SpringApplication.run(AvroSourceApplication.class,
|
||||
|
||||
@@ -16,11 +16,13 @@
|
||||
|
||||
package org.springframework.cloud.stream.test.binder;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||
import org.springframework.cloud.stream.binder.Binder;
|
||||
import org.springframework.cloud.stream.binder.BinderFactory;
|
||||
import org.springframework.cloud.stream.binder.ConsumerProperties;
|
||||
import org.springframework.cloud.stream.binder.ProducerProperties;
|
||||
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;
|
||||
@@ -43,6 +45,7 @@ import org.springframework.messaging.MessageChannel;
|
||||
@Configuration
|
||||
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
|
||||
@Import(TestSupportBinderConfiguration.class)
|
||||
@AutoConfigureBefore(BindingServiceConfiguration.class)
|
||||
public class TestSupportBinderAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.aggregate.AggregateApplication;
|
||||
@@ -43,8 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = AggregateWithBeanTest.ChainedProcessors.class, properties = { "server.port=-1","--spring.cloud.stream.bindings.input.contentType=text/plain",
|
||||
"--spring.cloud.stream.bindings.output.contentType=text/plain",
|
||||
"--spring.main.allow-bean-definition-overriding=true"})
|
||||
"--spring.cloud.stream.bindings.output.contentType=text/plain"})
|
||||
public class AggregateWithBeanTest {
|
||||
|
||||
@Autowired
|
||||
@@ -77,6 +77,7 @@ public class AggregateWithBeanTest {
|
||||
|
||||
@Configuration
|
||||
@EnableBinding(Processor.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class UppercaseProcessor {
|
||||
|
||||
@Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)
|
||||
@@ -87,6 +88,7 @@ public class AggregateWithBeanTest {
|
||||
|
||||
@Configuration
|
||||
@EnableBinding(Processor.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class SuffixProcessor {
|
||||
|
||||
@Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.cloud.stream.test.aggregate.main;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -43,12 +42,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
public class AggregateWithMainTest {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("server.port", "0");
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testAggregateApplication() throws InterruptedException {
|
||||
@@ -77,6 +70,7 @@ public class AggregateWithMainTest {
|
||||
|
||||
@Configuration
|
||||
@EnableBinding(Processor.class)
|
||||
@EnableAutoConfiguration
|
||||
static class UppercaseProcessor {
|
||||
|
||||
@Autowired
|
||||
@@ -91,6 +85,7 @@ public class AggregateWithMainTest {
|
||||
|
||||
@Configuration
|
||||
@EnableBinding(Processor.class)
|
||||
@EnableAutoConfiguration
|
||||
static class SuffixProcessor {
|
||||
|
||||
@Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)
|
||||
|
||||
@@ -39,8 +39,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* correctly.
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = ExampleTest.MyProcessor.class, properties = { "server.port=-1", "--spring.cloud.stream.bindings.input.contentType=text/plain", "--spring.cloud.stream.bindings.output.contentType=text/plain",
|
||||
"--spring.main.allow-bean-definition-overriding=true"})
|
||||
@SpringBootTest(classes = ExampleTest.MyProcessor.class, properties = { "server.port=-1",
|
||||
"--spring.cloud.stream.bindings.input.contentType=text/plain",
|
||||
"--spring.cloud.stream.bindings.output.contentType=text/plain"})
|
||||
@DirtiesContext
|
||||
public class ExampleTest {
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.cloud.stream.config.BinderFactoryConfiguration;
|
||||
import org.springframework.cloud.stream.config.BindingBeansRegistrar;
|
||||
import org.springframework.cloud.stream.config.BindingServiceConfiguration;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
@@ -37,13 +36,14 @@ import org.springframework.integration.config.EnableIntegration;
|
||||
* @author Dave Syer
|
||||
* @author Marius Bogoevici
|
||||
* @author David Turanski
|
||||
* @author Soby Chacko
|
||||
*/
|
||||
@Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Inherited
|
||||
@Configuration
|
||||
@Import({ BindingServiceConfiguration.class, BindingBeansRegistrar.class, BinderFactoryConfiguration.class})
|
||||
@Import({ BindingBeansRegistrar.class, BinderFactoryConfiguration.class})
|
||||
@EnableIntegration
|
||||
public @interface EnableBinding {
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -34,9 +32,6 @@ import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.cloud.stream.binder.BinderConfiguration;
|
||||
import org.springframework.cloud.stream.binder.BinderFactory;
|
||||
import org.springframework.cloud.stream.binder.BinderType;
|
||||
import org.springframework.cloud.stream.binder.BinderTypeRegistry;
|
||||
import org.springframework.cloud.stream.binder.DefaultBinderFactory;
|
||||
@@ -48,7 +43,6 @@ import org.springframework.context.annotation.Role;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.UrlResource;
|
||||
import org.springframework.core.io.support.PropertiesLoaderUtils;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -56,6 +50,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Marius Bogoevici
|
||||
* @author Ilayaperumal Gopinathan
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Soby Chacko
|
||||
*/
|
||||
@Configuration
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
@@ -93,62 +88,6 @@ public class BinderFactoryConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(BinderFactory.class)
|
||||
public DefaultBinderFactory binderFactory(BinderTypeRegistry binderTypeRegistry,
|
||||
BindingServiceProperties bindingServiceProperties) {
|
||||
DefaultBinderFactory binderFactory = new DefaultBinderFactory(
|
||||
getBinderConfigurations(binderTypeRegistry, bindingServiceProperties), binderTypeRegistry);
|
||||
binderFactory.setDefaultBinder(bindingServiceProperties.getDefaultBinder());
|
||||
binderFactory.setListeners(binderFactoryListeners);
|
||||
return binderFactory;
|
||||
}
|
||||
|
||||
private Map<String, BinderConfiguration> getBinderConfigurations(BinderTypeRegistry binderTypeRegistry,
|
||||
BindingServiceProperties bindingServiceProperties) {
|
||||
Map<String, BinderConfiguration> binderConfigurations = new HashMap<>();
|
||||
Map<String, BinderProperties> declaredBinders = bindingServiceProperties.getBinders();
|
||||
boolean defaultCandidatesExist = false;
|
||||
Iterator<Map.Entry<String, BinderProperties>> binderPropertiesIterator = declaredBinders.entrySet().iterator();
|
||||
while (!defaultCandidatesExist && binderPropertiesIterator.hasNext()) {
|
||||
defaultCandidatesExist = binderPropertiesIterator.next().getValue().isDefaultCandidate();
|
||||
}
|
||||
List<String> existingBinderConfigurations = new ArrayList<>();
|
||||
for (Map.Entry<String, BinderProperties> binderEntry : declaredBinders.entrySet()) {
|
||||
BinderProperties binderProperties = binderEntry.getValue();
|
||||
if (binderTypeRegistry.get(binderEntry.getKey()) != null) {
|
||||
binderConfigurations.put(binderEntry.getKey(),
|
||||
new BinderConfiguration(binderEntry.getKey(),
|
||||
binderProperties.getEnvironment(), binderProperties.isInheritEnvironment(),
|
||||
binderProperties.isDefaultCandidate()));
|
||||
existingBinderConfigurations.add(binderEntry.getKey());
|
||||
}
|
||||
else {
|
||||
Assert.hasText(binderProperties.getType(),
|
||||
"No 'type' property present for custom binder " + binderEntry.getKey());
|
||||
binderConfigurations.put(binderEntry.getKey(),
|
||||
new BinderConfiguration(binderProperties.getType(), binderProperties.getEnvironment(),
|
||||
binderProperties.isInheritEnvironment(), binderProperties.isDefaultCandidate()));
|
||||
existingBinderConfigurations.add(binderEntry.getKey());
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, BinderConfiguration> configurationEntry : binderConfigurations.entrySet()) {
|
||||
if (configurationEntry.getValue().isDefaultCandidate()) {
|
||||
defaultCandidatesExist = true;
|
||||
}
|
||||
}
|
||||
if (!defaultCandidatesExist) {
|
||||
for (Map.Entry<String, BinderType> binderEntry : binderTypeRegistry.getAll().entrySet()) {
|
||||
if (!existingBinderConfigurations.contains(binderEntry.getKey())) {
|
||||
binderConfigurations.put(binderEntry.getKey(), new BinderConfiguration(binderEntry.getKey(),
|
||||
new HashMap<>(), true, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
return binderConfigurations;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(BinderTypeRegistry.class)
|
||||
public BinderTypeRegistry binderTypeRegistry(ConfigurableApplicationContext configurableApplicationContext) {
|
||||
Map<String, BinderType> binderTypes = new HashMap<>();
|
||||
ClassLoader classLoader = configurableApplicationContext.getClassLoader();
|
||||
|
||||
@@ -26,10 +26,12 @@ import org.springframework.boot.actuate.health.CompositeHealthIndicator;
|
||||
import org.springframework.boot.actuate.health.Health;
|
||||
import org.springframework.boot.actuate.health.HealthIndicator;
|
||||
import org.springframework.boot.actuate.health.OrderedHealthAggregator;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.cloud.stream.binder.BinderFactory;
|
||||
import org.springframework.cloud.stream.binder.DefaultBinderFactory;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -41,7 +43,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
@ConditionalOnClass(name = "org.springframework.boot.actuate.health.HealthIndicator")
|
||||
@ConditionalOnEnabledHealthIndicator("binders")
|
||||
@AutoConfigureBefore(EndpointAutoConfiguration.class)
|
||||
@ConditionalOnBean(DefaultBinderFactory.class)
|
||||
@ConditionalOnBean(BinderFactory.class)
|
||||
@AutoConfigureAfter(BindingServiceConfiguration.class)
|
||||
@Configuration
|
||||
public class BindersHealthIndicatorAutoConfiguration {
|
||||
|
||||
|
||||
@@ -17,15 +17,23 @@
|
||||
package org.springframework.cloud.stream.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.cloud.stream.binder.BinderConfiguration;
|
||||
import org.springframework.cloud.stream.binder.BinderFactory;
|
||||
import org.springframework.cloud.stream.binder.BinderType;
|
||||
import org.springframework.cloud.stream.binder.BinderTypeRegistry;
|
||||
import org.springframework.cloud.stream.binder.DefaultBinderFactory;
|
||||
import org.springframework.cloud.stream.binding.AbstractBindingTargetFactory;
|
||||
import org.springframework.cloud.stream.binding.Bindable;
|
||||
import org.springframework.cloud.stream.binding.BinderAwareChannelResolver;
|
||||
@@ -61,6 +69,7 @@ import org.springframework.messaging.core.DestinationResolver;
|
||||
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory;
|
||||
import org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory;
|
||||
import org.springframework.scheduling.TaskScheduler;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
/**
|
||||
@@ -74,16 +83,76 @@ import org.springframework.scheduling.TaskScheduler;
|
||||
* @author Vinicius Carvalho
|
||||
* @author Artem Bilan
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Soby Chacko
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties({ BindingServiceProperties.class, SpringIntegrationProperties.class })
|
||||
@Import({ContentTypeConfiguration.class, DestinationPublishingMetricsAutoConfiguration.class, SpelExpressionConverterConfiguration.class})
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
@ConditionalOnBean(BinderTypeRegistry.class)
|
||||
public class BindingServiceConfiguration {
|
||||
|
||||
public static final String STREAM_LISTENER_ANNOTATION_BEAN_POST_PROCESSOR_NAME =
|
||||
"streamListenerAnnotationBeanPostProcessor";
|
||||
|
||||
@Autowired(required = false)
|
||||
private Collection<DefaultBinderFactory.Listener> binderFactoryListeners;
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(BinderFactory.class)
|
||||
public BinderFactory binderFactory(BinderTypeRegistry binderTypeRegistry,
|
||||
BindingServiceProperties bindingServiceProperties) {
|
||||
DefaultBinderFactory binderFactory = new DefaultBinderFactory(
|
||||
getBinderConfigurations(binderTypeRegistry, bindingServiceProperties), binderTypeRegistry);
|
||||
binderFactory.setDefaultBinder(bindingServiceProperties.getDefaultBinder());
|
||||
binderFactory.setListeners(binderFactoryListeners);
|
||||
return binderFactory;
|
||||
}
|
||||
|
||||
private static Map<String, BinderConfiguration> getBinderConfigurations(BinderTypeRegistry binderTypeRegistry,
|
||||
BindingServiceProperties bindingServiceProperties) {
|
||||
Map<String, BinderConfiguration> binderConfigurations = new HashMap<>();
|
||||
Map<String, BinderProperties> declaredBinders = bindingServiceProperties.getBinders();
|
||||
boolean defaultCandidatesExist = false;
|
||||
Iterator<Map.Entry<String, BinderProperties>> binderPropertiesIterator = declaredBinders.entrySet().iterator();
|
||||
while (!defaultCandidatesExist && binderPropertiesIterator.hasNext()) {
|
||||
defaultCandidatesExist = binderPropertiesIterator.next().getValue().isDefaultCandidate();
|
||||
}
|
||||
List<String> existingBinderConfigurations = new ArrayList<>();
|
||||
for (Map.Entry<String, BinderProperties> binderEntry : declaredBinders.entrySet()) {
|
||||
BinderProperties binderProperties = binderEntry.getValue();
|
||||
if (binderTypeRegistry.get(binderEntry.getKey()) != null) {
|
||||
binderConfigurations.put(binderEntry.getKey(),
|
||||
new BinderConfiguration(binderEntry.getKey(),
|
||||
binderProperties.getEnvironment(), binderProperties.isInheritEnvironment(),
|
||||
binderProperties.isDefaultCandidate()));
|
||||
existingBinderConfigurations.add(binderEntry.getKey());
|
||||
}
|
||||
else {
|
||||
Assert.hasText(binderProperties.getType(),
|
||||
"No 'type' property present for custom binder " + binderEntry.getKey());
|
||||
binderConfigurations.put(binderEntry.getKey(),
|
||||
new BinderConfiguration(binderProperties.getType(), binderProperties.getEnvironment(),
|
||||
binderProperties.isInheritEnvironment(), binderProperties.isDefaultCandidate()));
|
||||
existingBinderConfigurations.add(binderEntry.getKey());
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, BinderConfiguration> configurationEntry : binderConfigurations.entrySet()) {
|
||||
if (configurationEntry.getValue().isDefaultCandidate()) {
|
||||
defaultCandidatesExist = true;
|
||||
}
|
||||
}
|
||||
if (!defaultCandidatesExist) {
|
||||
for (Map.Entry<String, BinderType> binderEntry : binderTypeRegistry.getAll().entrySet()) {
|
||||
if (!existingBinderConfigurations.contains(binderEntry.getKey())) {
|
||||
binderConfigurations.put(binderEntry.getKey(), new BinderConfiguration(binderEntry.getKey(),
|
||||
new HashMap<>(), true, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
return binderConfigurations;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MessageChannelStreamListenerResultAdapter messageChannelStreamListenerResultAdapter() {
|
||||
return new MessageChannelStreamListenerResultAdapter();
|
||||
@@ -99,6 +168,7 @@ public class BindingServiceConfiguration {
|
||||
}
|
||||
|
||||
@Bean(name = STREAM_LISTENER_ANNOTATION_BEAN_POST_PROCESSOR_NAME)
|
||||
@ConditionalOnMissingBean
|
||||
public static StreamListenerAnnotationBeanPostProcessor streamListenerAnnotationBeanPostProcessor() {
|
||||
return new StreamListenerAnnotationBeanPostProcessor();
|
||||
}
|
||||
|
||||
@@ -2,5 +2,7 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration:\
|
||||
org.springframework.cloud.stream.config.ChannelBindingAutoConfiguration,\
|
||||
org.springframework.cloud.stream.config.BindersHealthIndicatorAutoConfiguration,\
|
||||
org.springframework.cloud.stream.config.ChannelsEndpointAutoConfiguration,\
|
||||
org.springframework.cloud.stream.config.BindingsEndpointAutoConfiguration
|
||||
org.springframework.cloud.stream.config.BindingsEndpointAutoConfiguration,\
|
||||
org.springframework.cloud.stream.config.BindingServiceConfiguration
|
||||
|
||||
|
||||
|
||||
@@ -24,11 +24,12 @@ import java.util.Map;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.stream.aggregate.AggregateApplicationBuilder;
|
||||
import org.springframework.cloud.stream.aggregate.AggregateApplicationBuilder.SourceConfigurer;
|
||||
import org.springframework.cloud.stream.aggregate.SharedBindingTargetRegistry;
|
||||
@@ -41,7 +42,6 @@ import org.springframework.cloud.stream.messaging.Processor;
|
||||
import org.springframework.cloud.stream.messaging.Source;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
@@ -57,17 +57,12 @@ import static org.junit.Assert.assertTrue;
|
||||
* @author Artem Bilan
|
||||
* @author Janne Valkealahti
|
||||
* @author Gary Russell
|
||||
* @author Soby Chacko
|
||||
*/
|
||||
public class AggregationTest {
|
||||
|
||||
private ConfigurableApplicationContext aggregatedApplicationContext;
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
System.setProperty("server.port", "0");
|
||||
}
|
||||
|
||||
@After
|
||||
public void closeContext() {
|
||||
System.clearProperty("a.foo-value");
|
||||
@@ -82,7 +77,8 @@ public class AggregationTest {
|
||||
@Test
|
||||
public void aggregation() {
|
||||
aggregatedApplicationContext = new AggregateApplicationBuilder(
|
||||
MockBinderRegistryConfiguration.class, "--server.port=0", "--debug=true")
|
||||
FooConfig.class, "--server.port=0", "--debug=true",
|
||||
"--spring.cloud.stream.default-binder=mock")
|
||||
.web(false).from(TestSource.class).to(TestProcessor.class).run();
|
||||
SharedBindingTargetRegistry sharedBindingTargetRegistry = aggregatedApplicationContext
|
||||
.getBean(SharedBindingTargetRegistry.class);
|
||||
@@ -97,7 +93,8 @@ public class AggregationTest {
|
||||
public void testModuleAggregationUsingSharedChannelRegistry() {
|
||||
// test backward compatibility
|
||||
aggregatedApplicationContext = new AggregateApplicationBuilder(
|
||||
MockBinderRegistryConfiguration.class, "--server.port=0").web(false)
|
||||
FooConfig.class, "--server.port=0",
|
||||
"--spring.cloud.stream.default-binder=mock").web(false)
|
||||
.from(TestSource.class).to(TestProcessor.class).run();
|
||||
SharedBindingTargetRegistry sharedChannelRegistry = aggregatedApplicationContext
|
||||
.getBean(SharedBindingTargetRegistry.class);
|
||||
@@ -117,12 +114,14 @@ public class AggregationTest {
|
||||
argsToVerify.add("--foo2=bar2");
|
||||
argsToVerify.add("--foo3=bar3");
|
||||
argsToVerify.add("--server.port=0");
|
||||
argsToVerify.add("--spring.cloud.stream.default-binder=mock");
|
||||
AggregateApplicationBuilder aggregateApplicationBuilder = new AggregateApplicationBuilder(
|
||||
MockBinderRegistryConfiguration.class, "--foo1=bar1");
|
||||
final ConfigurableApplicationContext context = aggregateApplicationBuilder
|
||||
.parent(DummyConfig.class, "--foo2=bar2").web(false)
|
||||
.from(TestSource.class).namespace("foo").to(TestProcessor.class)
|
||||
.namespace("bar").run("--foo3=bar3", "--server.port=0");
|
||||
.namespace("bar").run("--foo3=bar3", "--server.port=0",
|
||||
"--spring.cloud.stream.default-binder=mock");
|
||||
DirectFieldAccessor aggregateApplicationBuilderAccessor = new DirectFieldAccessor(
|
||||
aggregateApplicationBuilder);
|
||||
final List<String> parentArgs = (List<String>) aggregateApplicationBuilderAccessor
|
||||
@@ -140,7 +139,7 @@ public class AggregationTest {
|
||||
final ConfigurableApplicationContext context = aggregateApplicationBuilder
|
||||
.parent(DummyConfig.class, "--foo2=bar2").web(false)
|
||||
.from(TestSource.class).namespace("foo").to(TestProcessor.class)
|
||||
.namespace("bar").run("--server.port=0");
|
||||
.namespace("bar").run("--server.port=0", "--spring.cloud.stream.default-binder=mock");
|
||||
DirectFieldAccessor aggregateApplicationBuilderAccessor = new DirectFieldAccessor(
|
||||
aggregateApplicationBuilder);
|
||||
List<Object> sources = (List<Object>) aggregateApplicationBuilderAccessor
|
||||
@@ -156,7 +155,7 @@ public class AggregationTest {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testNamespacePrefixesFromCmdLine() {
|
||||
AggregateApplicationBuilder aggregateApplicationBuilder = new AggregateApplicationBuilder(
|
||||
MockBinderRegistryConfiguration.class);
|
||||
FooConfig.class, "--spring.cloud.stream.default-binder=mock");
|
||||
aggregatedApplicationContext = aggregateApplicationBuilder
|
||||
.parent(DummyConfig.class).web(false).from(TestSource.class)
|
||||
.namespace("a").via(TestProcessor.class).namespace("b")
|
||||
@@ -187,7 +186,7 @@ public class AggregationTest {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testNamespacePrefixesFromCmdLineVsArgs() {
|
||||
AggregateApplicationBuilder aggregateApplicationBuilder = new AggregateApplicationBuilder(
|
||||
MockBinderRegistryConfiguration.class);
|
||||
FooConfig.class, "--spring.cloud.stream.default-binder=mock");
|
||||
aggregatedApplicationContext = aggregateApplicationBuilder
|
||||
.parent(DummyConfig.class).web(false).from(TestSource.class)
|
||||
.namespace("a").args("--fooValue=bar").via(TestProcessor.class)
|
||||
@@ -218,7 +217,7 @@ public class AggregationTest {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testNamespacePrefixesFromCmdLineWithRelaxedNames() {
|
||||
AggregateApplicationBuilder aggregateApplicationBuilder = new AggregateApplicationBuilder(
|
||||
MockBinderRegistryConfiguration.class);
|
||||
FooConfig.class, "--spring.cloud.stream.default-binder=mock");
|
||||
aggregatedApplicationContext = aggregateApplicationBuilder
|
||||
.parent(DummyConfig.class).web(false).from(TestSource.class)
|
||||
.namespace("a").args("--foo-value=bar").via(TestProcessor.class)
|
||||
@@ -250,7 +249,7 @@ public class AggregationTest {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testNamespacePrefixesFromCmdLineWithRelaxedNamesAndMorePropertySources() {
|
||||
AggregateApplicationBuilder aggregateApplicationBuilder = new AggregateApplicationBuilder(
|
||||
MockBinderRegistryConfiguration.class);
|
||||
FooConfig.class, "--spring.cloud.stream.default-binder=mock");
|
||||
System.setProperty("a.foo-value", "sysbara");
|
||||
System.setProperty("c.fooValue", "sysbarc");
|
||||
System.setProperty("server.port", "0");
|
||||
@@ -284,7 +283,7 @@ public class AggregationTest {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testNamespacePrefixesWithoutCmdLinePropertySource() {
|
||||
AggregateApplicationBuilder aggregateApplicationBuilder = new AggregateApplicationBuilder(
|
||||
MockBinderRegistryConfiguration.class);
|
||||
FooConfig.class, "--spring.cloud.stream.default-binder=mock");
|
||||
System.setProperty("a.foo-value", "sysbara");
|
||||
System.setProperty("c.fooValue", "sysbarc");
|
||||
System.setProperty("server.port", "0");
|
||||
@@ -317,7 +316,7 @@ public class AggregationTest {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testNamespacePrefixesWithCAPSProperties() {
|
||||
AggregateApplicationBuilder aggregateApplicationBuilder = new AggregateApplicationBuilder(
|
||||
MockBinderRegistryConfiguration.class);
|
||||
FooConfig.class, "--spring.cloud.stream.default-binder=mock");
|
||||
System.setProperty("a.fooValue", "sysbara");
|
||||
System.setProperty("c.fooValue", "sysbarc");
|
||||
aggregatedApplicationContext = aggregateApplicationBuilder
|
||||
@@ -348,7 +347,7 @@ public class AggregationTest {
|
||||
@Test
|
||||
public void testNamespaces() {
|
||||
aggregatedApplicationContext = new AggregateApplicationBuilder(
|
||||
MockBinderRegistryConfiguration.class, "--server.port=0").web(false)
|
||||
FooConfig.class, "--server.port=0", "--spring.cloud.stream.default-binder=mock").web(false)
|
||||
.from(TestSource.class).namespace("foo").to(TestProcessor.class)
|
||||
.namespace("bar").run();
|
||||
SharedBindingTargetRegistry sharedChannelRegistry = aggregatedApplicationContext
|
||||
@@ -367,9 +366,11 @@ public class AggregationTest {
|
||||
|
||||
@Test
|
||||
public void testBindableProxyFactoryCaching() {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
|
||||
MockBinderRegistryConfiguration.class, TestSource2.class,
|
||||
TestProcessor.class);
|
||||
ConfigurableApplicationContext context = new SpringApplicationBuilder(TestSource2.class,
|
||||
TestProcessor.class)
|
||||
.web(WebApplicationType.NONE)
|
||||
.run("--spring.cloud.stream.default-binder=mock");
|
||||
|
||||
Map<String, BindableProxyFactory> factories = context
|
||||
.getBeansOfType(BindableProxyFactory.class);
|
||||
assertThat(factories).hasSize(2);
|
||||
@@ -443,4 +444,10 @@ public class AggregationTest {
|
||||
public static class DummyConfig {
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
public static class FooConfig {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@@ -41,7 +39,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = ArbitraryInterfaceWithBindingTargetsTests.TestFooChannels.class,
|
||||
properties = "spring.main.allow-bean-definition-overriding=true")
|
||||
properties = "spring.cloud.stream.default-binder=mock")
|
||||
public class ArbitraryInterfaceWithBindingTargetsTests {
|
||||
|
||||
@Autowired
|
||||
@@ -67,7 +65,6 @@ public class ArbitraryInterfaceWithBindingTargetsTests {
|
||||
|
||||
@EnableBinding(FooChannels.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
@PropertySource("classpath:/org/springframework/cloud/stream/binder/arbitrary-binding-test.properties")
|
||||
public static class TestFooChannels {
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -40,7 +38,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = ArbitraryInterfaceWithDefaultsTests.TestFooChannels.class,
|
||||
properties = "spring.main.allow-bean-definition-overriding=true")
|
||||
properties = "spring.cloud.stream.default-binder=mock")
|
||||
public class ArbitraryInterfaceWithDefaultsTests {
|
||||
|
||||
@Autowired
|
||||
@@ -66,7 +64,6 @@ public class ArbitraryInterfaceWithDefaultsTests {
|
||||
|
||||
@EnableBinding(FooChannels.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
public static class TestFooChannels {
|
||||
|
||||
}
|
||||
|
||||
@@ -94,7 +94,6 @@ public class BinderAwareChannelResolverTests {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Before
|
||||
public void setupContext() throws Exception {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
|
||||
this.context = new SpringApplicationBuilder(TestChannelBinderConfiguration.getCompleteConfiguration(BinderAwareChannelResolverTests.InterceptorConfiguration.class))
|
||||
.web(WebApplicationType.NONE).run();
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.springframework.cloud.stream.binder.stub2.StubBinder2;
|
||||
import org.springframework.cloud.stream.binder.stub2.StubBinder2ConfigurationA;
|
||||
import org.springframework.cloud.stream.binder.stub2.StubBinder2ConfigurationB;
|
||||
import org.springframework.cloud.stream.config.BinderFactoryConfiguration;
|
||||
import org.springframework.cloud.stream.config.BindingServiceConfiguration;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
@@ -93,11 +94,11 @@ public class BinderFactoryConfigurationTests {
|
||||
@Test
|
||||
public void loadBinderTypeRegistryWithOneBinder() throws Exception {
|
||||
ConfigurableApplicationContext context = createBinderTestContext(
|
||||
new String[] { "binder1" });
|
||||
new String[] { "binder1" }, "spring.cloud.stream.default-binder=binder1");
|
||||
|
||||
BinderTypeRegistry binderTypeRegistry = context.getBean(BinderTypeRegistry.class);
|
||||
assertThat(binderTypeRegistry).isNotNull();
|
||||
assertThat(binderTypeRegistry.getAll()).hasSize(1);
|
||||
assertThat(binderTypeRegistry.getAll()).hasSize(3);
|
||||
assertThat(binderTypeRegistry.getAll()).containsKey("binder1");
|
||||
assertThat((Class[]) binderTypeRegistry.get("binder1").getConfigurationClasses())
|
||||
.containsExactlyInAnyOrder(StubBinder1Configuration.class);
|
||||
@@ -176,8 +177,8 @@ public class BinderFactoryConfigurationTests {
|
||||
ConfigurableApplicationContext context = createBinderTestContext(new String[] { "binder1", "binder2" });
|
||||
BinderTypeRegistry binderTypeRegistry = context.getBean(BinderTypeRegistry.class);
|
||||
assertThat(binderTypeRegistry).isNotNull();
|
||||
assertThat(binderTypeRegistry.getAll()).hasSize(2);
|
||||
assertThat(binderTypeRegistry.getAll()).containsOnlyKeys("binder1", "binder2");
|
||||
assertThat(binderTypeRegistry.getAll()).hasSize(4);
|
||||
assertThat(binderTypeRegistry.getAll()).containsOnlyKeys("binder1", "binder2", "mock", "integration");
|
||||
assertThat((Class[]) binderTypeRegistry.get("binder1").getConfigurationClasses())
|
||||
.containsExactly(StubBinder1Configuration.class);
|
||||
assertThat((Class[]) binderTypeRegistry.get("binder2").getConfigurationClasses())
|
||||
@@ -208,10 +209,11 @@ public class BinderFactoryConfigurationTests {
|
||||
new String[] { "binder1" },
|
||||
"spring.cloud.stream.binders.custom.type=binder1",
|
||||
"spring.cloud.stream.binders.custom.defaultCandidate=false",
|
||||
"spring.cloud.stream.binders.custom.inheritEnvironment=false");
|
||||
"spring.cloud.stream.binders.custom.inheritEnvironment=false",
|
||||
"spring.cloud.stream.default-binder=binder1");
|
||||
BinderTypeRegistry binderTypeRegistry = context.getBean(BinderTypeRegistry.class);
|
||||
assertThat(binderTypeRegistry).isNotNull();
|
||||
assertThat(binderTypeRegistry.getAll().size()).isEqualTo(1);
|
||||
assertThat(binderTypeRegistry.getAll().size()).isEqualTo(3);
|
||||
assertThat(binderTypeRegistry.getAll().keySet().contains("binder1"));
|
||||
assertThat((Class[]) binderTypeRegistry.get("binder1").getConfigurationClasses())
|
||||
.contains(StubBinder1Configuration.class);
|
||||
@@ -236,8 +238,8 @@ public class BinderFactoryConfigurationTests {
|
||||
"spring.cloud.stream.defaultBinder:binder2");
|
||||
BinderTypeRegistry binderTypeRegistry = context.getBean(BinderTypeRegistry.class);
|
||||
assertThat(binderTypeRegistry).isNotNull();
|
||||
assertThat(binderTypeRegistry.getAll()).hasSize(2);
|
||||
assertThat(binderTypeRegistry.getAll()).containsOnlyKeys("binder1", "binder2");
|
||||
assertThat(binderTypeRegistry.getAll()).hasSize(4);
|
||||
assertThat(binderTypeRegistry.getAll()).containsOnlyKeys("binder1", "binder2", "mock", "integration");
|
||||
assertThat((Class[]) binderTypeRegistry.get("binder1").getConfigurationClasses())
|
||||
.containsExactlyInAnyOrder(StubBinder1Configuration.class);
|
||||
assertThat((Class[]) binderTypeRegistry.get("binder2").getConfigurationClasses())
|
||||
@@ -254,7 +256,7 @@ public class BinderFactoryConfigurationTests {
|
||||
assertThat(defaultBinder).isSameAs(binder2);
|
||||
}
|
||||
|
||||
@Import({ BinderFactoryConfiguration.class, PropertyPlaceholderAutoConfiguration.class })
|
||||
@Import({ BinderFactoryConfiguration.class, PropertyPlaceholderAutoConfiguration.class, BindingServiceConfiguration.class})
|
||||
@EnableBinding
|
||||
public static class SimpleApplication {
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.cloud.stream.binder;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
@@ -24,9 +23,7 @@ import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.messaging.Processor;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
@@ -38,16 +35,11 @@ import static org.mockito.ArgumentMatchers.isNull;
|
||||
*/
|
||||
public class ErrorBindingTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Test
|
||||
public void testErrorChannelNotBoundByDefault() {
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(TestProcessor.class,
|
||||
"--server.port=0");
|
||||
"--server.port=0", "--spring.cloud.stream.default-binder=mock");
|
||||
BinderFactory binderFactory = applicationContext.getBean(BinderFactory.class);
|
||||
|
||||
Binder binder = binderFactory.getBinder(null, MessageChannel.class);
|
||||
@@ -61,7 +53,6 @@ public class ErrorBindingTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
public static class TestProcessor {
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.cloud.stream.binder;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
@@ -24,13 +23,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.config.BinderFactoryConfiguration;
|
||||
import org.springframework.cloud.stream.messaging.Processor;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.SmartLifecycle;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -46,15 +42,11 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
*/
|
||||
public class InputOutputBindingOrderTest {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Test
|
||||
public void testInputOutputBindingOrder() {
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(TestSource.class, "--server.port=-1");
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(TestSource.class, "--server.port=-1",
|
||||
"--spring.cloud.stream.defaultBinder=mock");
|
||||
@SuppressWarnings("rawtypes")
|
||||
Binder binder = applicationContext.getBean(BinderFactory.class).getBinder(null, MessageChannel.class);
|
||||
Processor processor = applicationContext.getBean(Processor.class);
|
||||
@@ -69,7 +61,6 @@ public class InputOutputBindingOrderTest {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import({ MockBinderRegistryConfiguration.class, BinderFactoryConfiguration.class })
|
||||
public static class TestSource {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -16,18 +16,15 @@
|
||||
|
||||
package org.springframework.cloud.stream.binder;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.messaging.Source;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.Lifecycle;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -37,14 +34,10 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
public class LifecycleBinderTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOnlySmartLifecyclesStarted() {
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(TestSource.class, "--server.port=-1");
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(TestSource.class,
|
||||
"--server.port=-1", "--spring.cloud.stream.defaultBinder=mock");
|
||||
SimpleLifecycle simpleLifecycle = applicationContext.getBean(SimpleLifecycle.class);
|
||||
assertThat(simpleLifecycle.isRunning()).isFalse();
|
||||
applicationContext.close();
|
||||
@@ -52,7 +45,6 @@ public class LifecycleBinderTests {
|
||||
|
||||
@EnableBinding(Source.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
public static class TestSource {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.stream.binder;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -63,7 +64,6 @@ public class PollableConsumerTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
//System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
this.messageConverter = new CompositeMessageConverterFactory().getMessageConverterForAllRegistered();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.messaging.Processor;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@@ -41,7 +39,7 @@ import static org.mockito.Mockito.verify;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = ProcessorBindingWithBindingTargetsTests.TestProcessor.class,
|
||||
properties = "spring.main.allow-bean-definition-overriding=true")
|
||||
properties = "spring.cloud.stream.defaultBinder=mock")
|
||||
public class ProcessorBindingWithBindingTargetsTests {
|
||||
|
||||
@Autowired
|
||||
@@ -62,7 +60,6 @@ public class ProcessorBindingWithBindingTargetsTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
@PropertySource("classpath:/org/springframework/cloud/stream/binder/processor-binding-test.properties")
|
||||
public static class TestProcessor {
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.messaging.Processor;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -40,7 +38,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = ProcessorBindingsWithDefaultsTests.TestProcessor.class,
|
||||
properties = "spring.main.allow-bean-definition-overriding=true")
|
||||
properties = "spring.cloud.stream.defaultBinder=mock")
|
||||
public class ProcessorBindingsWithDefaultsTests {
|
||||
|
||||
@Autowired
|
||||
@@ -62,7 +60,6 @@ public class ProcessorBindingsWithDefaultsTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
public static class TestProcessor {
|
||||
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.messaging.Sink;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@@ -43,7 +41,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = SinkBindingWithDefaultTargetsTests.TestSink.class,
|
||||
properties = "spring.main.allow-bean-definition-overriding=true")
|
||||
properties = "spring.cloud.stream.defaultBinder=mock")
|
||||
public class SinkBindingWithDefaultTargetsTests {
|
||||
|
||||
@Autowired
|
||||
@@ -63,7 +61,6 @@ public class SinkBindingWithDefaultTargetsTests {
|
||||
|
||||
@EnableBinding(Sink.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
@PropertySource("classpath:/org/springframework/cloud/stream/binder/sink-binding-test.properties")
|
||||
public static class TestSink {
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.messaging.Sink;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -41,7 +39,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = SinkBindingWithDefaultsTests.TestSink.class,
|
||||
properties = "spring.main.allow-bean-definition-overriding=true")
|
||||
properties = "spring.cloud.stream.defaultBinder=mock")
|
||||
public class SinkBindingWithDefaultsTests {
|
||||
|
||||
@Autowired
|
||||
@@ -61,7 +59,6 @@ public class SinkBindingWithDefaultsTests {
|
||||
|
||||
@EnableBinding(Sink.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
public static class TestSink {
|
||||
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.messaging.Source;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.integration.channel.PublishSubscribeChannel;
|
||||
import org.springframework.integration.context.IntegrationContextUtils;
|
||||
@@ -44,7 +42,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = SourceBindingWithBindingTargetsTests.TestSource.class,
|
||||
properties = "spring.main.allow-bean-definition-overriding=true")
|
||||
properties = "spring.cloud.stream.defaultBinder=mock")
|
||||
public class SourceBindingWithBindingTargetsTests {
|
||||
|
||||
@Autowired
|
||||
@@ -68,7 +66,6 @@ public class SourceBindingWithBindingTargetsTests {
|
||||
|
||||
@EnableBinding(Source.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
@PropertySource("classpath:/org/springframework/cloud/stream/binder/source-binding-test.properties")
|
||||
public static class TestSource {
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.cloud.stream.binder;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mockito;
|
||||
@@ -26,8 +25,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.messaging.Source;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -40,7 +37,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = SourceBindingWithDefaultsTests.TestSource.class,
|
||||
properties = "spring.main.allow-bean-definition-overriding=true")
|
||||
properties = "spring.cloud.stream.defaultBinder=mock")
|
||||
public class SourceBindingWithDefaultsTests {
|
||||
|
||||
@Autowired
|
||||
@@ -49,11 +46,6 @@ public class SourceBindingWithDefaultsTests {
|
||||
@Autowired
|
||||
private Source testSource;
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Test
|
||||
public void testSourceOutputChannelBound() {
|
||||
@@ -64,7 +56,6 @@ public class SourceBindingWithDefaultsTests {
|
||||
|
||||
@EnableBinding(Source.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
public static class TestSource {
|
||||
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@ import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.config.BindingProperties;
|
||||
import org.springframework.cloud.stream.config.BindingServiceProperties;
|
||||
import org.springframework.cloud.stream.messaging.Source;
|
||||
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
@@ -45,7 +43,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
"spring.cloud.stream.default.producer.partitionCount=1",
|
||||
"spring.cloud.stream.bindings.output.producer.headerMode=none",
|
||||
"spring.cloud.stream.bindings.output.producer.partitionCount=4",
|
||||
"spring.main.allow-bean-definition-overriding=true"})
|
||||
"spring.cloud.stream.defaultBinder=mock"})
|
||||
public class SourceBindingWithGlobalPropertiesTest {
|
||||
|
||||
@Autowired
|
||||
@@ -63,7 +61,6 @@ public class SourceBindingWithGlobalPropertiesTest {
|
||||
|
||||
@EnableBinding(Source.class)
|
||||
@EnableAutoConfiguration
|
||||
@Import(MockBinderRegistryConfiguration.class)
|
||||
public static class TestSource {
|
||||
|
||||
}
|
||||
|
||||
@@ -22,11 +22,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.annotation.StreamListener;
|
||||
@@ -74,11 +73,6 @@ import static org.junit.Assert.assertTrue;
|
||||
*/
|
||||
public class ContentTypeTckTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void stringToMapStreamListener() {
|
||||
ApplicationContext context = new SpringApplicationBuilder(StringToMapStreamListener.class)
|
||||
@@ -470,6 +464,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class CollectionWithParameterizedTypes {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -481,6 +476,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class TextInJsonOutListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -491,6 +487,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class PojoToPojoStreamListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -501,6 +498,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class PojoToStringStreamListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -511,6 +509,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class PojoToByteArrayStreamListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -521,6 +520,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class ByteArrayToPojoStreamListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -532,6 +532,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class StringToPojoStreamListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -543,6 +544,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class ByteArrayToByteArrayStreamListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -553,6 +555,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class StringToStringStreamListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -563,6 +566,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class StringToMapStreamListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -573,6 +577,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class StringToMapMessageStreamListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -584,6 +589,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class PojoMessageToStringMessageStreamListener {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo(Processor.OUTPUT)
|
||||
@@ -594,6 +600,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class PojoMessageToStringMessageServiceActivator {
|
||||
@ServiceActivator(inputChannel=Processor.INPUT, outputChannel=Processor.OUTPUT)
|
||||
public Message<String> echo(Message<Person> value) {
|
||||
@@ -603,6 +610,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class StringMessageToStringMessageStreamListener {
|
||||
@ServiceActivator(inputChannel=Processor.INPUT, outputChannel=Processor.OUTPUT)
|
||||
public Message<String> echo(Message<String> value) throws Exception {
|
||||
@@ -614,6 +622,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class ByteArrayMessageToStringJsonMessageStreamListener {
|
||||
@ServiceActivator(inputChannel=Processor.INPUT, outputChannel=Processor.OUTPUT)
|
||||
public Message<String> echo(Message<byte[]> value) throws Exception {
|
||||
@@ -627,6 +636,7 @@ public class ContentTypeTckTests {
|
||||
|
||||
@EnableBinding(Processor.class)
|
||||
@Import(TestChannelBinderConfiguration.class)
|
||||
@EnableAutoConfiguration
|
||||
public static class InternalPipeLine {
|
||||
@StreamListener(Processor.INPUT)
|
||||
@SendTo("internalChannel")
|
||||
|
||||
@@ -18,18 +18,15 @@ package org.springframework.cloud.stream.binder.test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.binder.Binder;
|
||||
import org.springframework.cloud.stream.binder.BinderType;
|
||||
import org.springframework.cloud.stream.binder.BinderTypeRegistry;
|
||||
import org.springframework.cloud.stream.binder.ConsumerProperties;
|
||||
import org.springframework.cloud.stream.binder.DefaultBinderTypeRegistry;
|
||||
import org.springframework.cloud.stream.binder.ProducerProperties;
|
||||
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;
|
||||
@@ -65,19 +62,13 @@ public class TestChannelBinderConfiguration<T> {
|
||||
Import annotation = AnnotationUtils.getAnnotation(EnableBinding.class, Import.class);
|
||||
Map<String, Object> annotationAttributes = AnnotationUtils.getAnnotationAttributes(annotation);
|
||||
configClasses.addAll(Arrays.asList((Class<?>[])annotationAttributes.get("value")));
|
||||
configClasses.add(BindingServiceConfiguration.class);
|
||||
if (additionalConfigurationClasses != null) {
|
||||
configClasses.addAll(Arrays.asList(additionalConfigurationClasses));
|
||||
}
|
||||
return configClasses.toArray(new Class<?>[] {});
|
||||
}
|
||||
|
||||
@Bean
|
||||
public BinderTypeRegistry binderTypeRegistry() {
|
||||
BinderType binderType = new BinderType(NAME, new Class[] {TestChannelBinderConfiguration.class});
|
||||
BinderTypeRegistry btr = new DefaultBinderTypeRegistry(Collections.singletonMap(NAME, binderType));
|
||||
return btr;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public InputDestination sourceDestination() {
|
||||
return new InputDestination();
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.boot.context.properties.source.MapConfigurationPropertySource;
|
||||
import org.springframework.cloud.stream.binder.Binder;
|
||||
import org.springframework.cloud.stream.binder.BinderConfiguration;
|
||||
import org.springframework.cloud.stream.binder.BinderFactory;
|
||||
import org.springframework.cloud.stream.binder.BinderType;
|
||||
import org.springframework.cloud.stream.binder.BinderTypeRegistry;
|
||||
import org.springframework.cloud.stream.binder.Binding;
|
||||
@@ -47,8 +48,8 @@ import org.springframework.cloud.stream.binder.DefaultBinderTypeRegistry;
|
||||
import org.springframework.cloud.stream.binder.ExtendedProducerProperties;
|
||||
import org.springframework.cloud.stream.binder.ExtendedPropertiesBinder;
|
||||
import org.springframework.cloud.stream.binder.ProducerProperties;
|
||||
import org.springframework.cloud.stream.config.BinderFactoryConfiguration;
|
||||
import org.springframework.cloud.stream.config.BindingProperties;
|
||||
import org.springframework.cloud.stream.config.BindingServiceConfiguration;
|
||||
import org.springframework.cloud.stream.config.BindingServiceProperties;
|
||||
import org.springframework.cloud.stream.converter.CompositeMessageConverterFactory;
|
||||
import org.springframework.cloud.stream.reflection.GenericsUtils;
|
||||
@@ -403,7 +404,7 @@ public class BindingServiceTests {
|
||||
properties.put("spring.cloud.stream.binders.mock1.type", "mock");
|
||||
properties.put("spring.cloud.stream.binders.kafka1.type", "kafka");
|
||||
BindingServiceProperties bindingServiceProperties = createBindingServiceProperties(properties);
|
||||
DefaultBinderFactory binderFactory = new BinderFactoryConfiguration()
|
||||
BinderFactory binderFactory = new BindingServiceConfiguration()
|
||||
.binderFactory(createMockBinderTypeRegistry(), bindingServiceProperties);
|
||||
BindingService bindingService = new BindingService(bindingServiceProperties,
|
||||
binderFactory);
|
||||
@@ -421,7 +422,7 @@ public class BindingServiceTests {
|
||||
properties.put("spring.cloud.stream.binders.mock1.type", "mock");
|
||||
properties.put("spring.cloud.stream.binders.kafka1.type", "kafka");
|
||||
BindingServiceProperties bindingServiceProperties = createBindingServiceProperties(properties);
|
||||
DefaultBinderFactory binderFactory = new BinderFactoryConfiguration()
|
||||
BinderFactory binderFactory = new BindingServiceConfiguration()
|
||||
.binderFactory(createMockBinderTypeRegistry(), bindingServiceProperties);
|
||||
BindingService bindingService = new BindingService(bindingServiceProperties,
|
||||
binderFactory);
|
||||
|
||||
@@ -56,8 +56,7 @@ public class CustomPartitionedProducerTest {
|
||||
"--spring.jmx.enabled=false",
|
||||
"--spring.main.web-application-type=none",
|
||||
"--spring.cloud.stream.bindings.output.producer.partitionKeyExtractorClass=org.springframework.cloud.stream.partitioning.CustomPartitionKeyExtractorClass",
|
||||
"--spring.cloud.stream.bindings.output.producer.partitionSelectorClass=org.springframework.cloud.stream.partitioning.CustomPartitionSelectorClass",
|
||||
"--spring.main.allow-bean-definition-overriding=true");
|
||||
"--spring.cloud.stream.bindings.output.producer.partitionSelectorClass=org.springframework.cloud.stream.partitioning.CustomPartitionSelectorClass");
|
||||
Source testSource = context.getBean(Source.class);
|
||||
DirectChannel messageChannel = (DirectChannel) testSource.output();
|
||||
for (ChannelInterceptor channelInterceptor : messageChannel.getChannelInterceptors()) {
|
||||
@@ -88,8 +87,7 @@ public class CustomPartitionedProducerTest {
|
||||
"--spring.jmx.enabled=false",
|
||||
"--spring.main.web-application-type=none",
|
||||
"--spring.cloud.stream.bindings.output.producer.partitionKeyExtractorName=customPartitionKeyExtractor",
|
||||
"--spring.cloud.stream.bindings.output.producer.partitionSelectorName=customPartitionSelector",
|
||||
"--spring.main.allow-bean-definition-overriding=true");
|
||||
"--spring.cloud.stream.bindings.output.producer.partitionSelectorName=customPartitionSelector");
|
||||
Source testSource = context.getBean(Source.class);
|
||||
DirectChannel messageChannel = (DirectChannel) testSource.output();
|
||||
for (ChannelInterceptor channelInterceptor : messageChannel.getChannelInterceptors()) {
|
||||
@@ -117,7 +115,7 @@ public class CustomPartitionedProducerTest {
|
||||
@Test
|
||||
public void testCustomPartitionedProducerAsSingletons() {
|
||||
ApplicationContext context = SpringApplication.run(CustomPartitionedProducerTest.TestSource.class,
|
||||
"--spring.jmx.enabled=false", "--spring.main.web-application-type=none", "--spring.main.allow-bean-definition-overriding=true");
|
||||
"--spring.jmx.enabled=false", "--spring.main.web-application-type=none");
|
||||
Source testSource = context.getBean(Source.class);
|
||||
DirectChannel messageChannel = (DirectChannel) testSource.output();
|
||||
for (ChannelInterceptor channelInterceptor : messageChannel.getChannelInterceptors()) {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.cloud.stream.binding;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanDefinitionStoreException;
|
||||
@@ -39,11 +38,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
*/
|
||||
public class InvalidBindingConfigurationTests {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDuplicateBeanByBindingConfig() {
|
||||
assertThatThrownBy(
|
||||
|
||||
@@ -54,7 +54,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = SpelExpressionConverterConfigurationTests.Config.class,
|
||||
properties = {"expression: a.b", "spring.main.allow-bean-definition-overriding=true"})
|
||||
properties = {"expression: a.b"})
|
||||
public class SpelExpressionConverterConfigurationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -48,8 +48,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = BoundChannelsInterceptedTest.Foo.class,
|
||||
properties = "spring.main.allow-bean-definition-overriding=true")
|
||||
@SpringBootTest(classes = BoundChannelsInterceptedTest.Foo.class)
|
||||
public class BoundChannelsInterceptedTest {
|
||||
|
||||
public static final Message<?> TEST_MESSAGE = MessageBuilder.withPayload("bar").setHeader(MessageHeaders.CONTENT_TYPE, MimeTypeUtils.APPLICATION_JSON).build();
|
||||
|
||||
@@ -49,8 +49,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
* @author Janne Valkealahti
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = PartitionedConsumerTest.TestSink.class,
|
||||
properties = "spring.main.allow-bean-definition-overriding=true")
|
||||
@SpringBootTest(classes = PartitionedConsumerTest.TestSink.class)
|
||||
public class PartitionedConsumerTest {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -18,8 +18,13 @@ package org.springframework.cloud.stream.utils;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.cloud.stream.binder.BinderType;
|
||||
import org.springframework.cloud.stream.binder.BinderTypeRegistry;
|
||||
import org.springframework.cloud.stream.binder.DefaultBinderTypeRegistry;
|
||||
import org.springframework.cloud.stream.config.SpelExpressionConverterConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -36,8 +41,30 @@ import org.springframework.context.annotation.Import;
|
||||
public class MockBinderRegistryConfiguration {
|
||||
|
||||
@Bean
|
||||
public BinderTypeRegistry binderTypeRegistry() {
|
||||
return new DefaultBinderTypeRegistry(
|
||||
Collections.singletonMap("mock", new BinderType("", new Class[] { MockBinderConfiguration.class })));
|
||||
public static MockBinderRegistryFactoryPostProcessor mockBinderRegistryFactoryPostProcessor() {
|
||||
return new MockBinderRegistryFactoryPostProcessor();
|
||||
}
|
||||
|
||||
static class MockBinderRegistryFactoryPostProcessor implements BeanFactoryPostProcessor {
|
||||
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
||||
if (beanFactory.containsBean("binderTypeRegistry")) {
|
||||
|
||||
BeanDefinitionRegistry beanDefinitionRegistry =
|
||||
(BeanDefinitionRegistry) beanFactory;
|
||||
beanDefinitionRegistry.removeBeanDefinition("binderTypeRegistry");
|
||||
|
||||
DefaultBinderTypeRegistry mock = new DefaultBinderTypeRegistry(
|
||||
Collections.singletonMap("mock", new BinderType("", new Class[]{MockBinderConfiguration.class})));
|
||||
BeanDefinition mockDefn =
|
||||
BeanDefinitionBuilder.genericBeanDefinition((Class<DefaultBinderTypeRegistry>) mock.getClass(),
|
||||
() -> mock)
|
||||
.getRawBeanDefinition();
|
||||
|
||||
beanDefinitionRegistry.registerBeanDefinition("binderTypeRegistry", mockDefn);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
integration:\
|
||||
org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration
|
||||
mock:\
|
||||
org.springframework.cloud.stream.utils.MockBinderConfiguration
|
||||
Reference in New Issue
Block a user