From be96ec00cf882692716b78815c80349f1243d089 Mon Sep 17 00:00:00 2001
From: Oleg Zhurakousky
Date: Thu, 22 Feb 2018 20:53:46 -0500
Subject: [PATCH] Polish SI test binder after maven publishing
- Renamed classes and package to be consistent with the intentions of this binder (e.g., TestChannelBinder, TestChannelBinderConfiguration etc)
- Added package-info.java
Resolves #1241
---
spring-cloud-stream-binder-test/pom.xml | 6 +
spring-cloud-stream-integration-tests/pom.xml | 9 +-
spring-cloud-stream/pom.xml | 2 +-
.../AbstractMessageChannelBinderTests.java | 6 +-
.../BinderAwareChannelResolverTests.java | 4 +-
.../stream/binder/PollableConsumerTests.java | 24 ++--
...ceBindingWithGlobalPropertiesOnlyTest.java | 4 +-
.../binder/tck/ContentTypeTckTests.java | 122 +++++++++---------
.../AbstractDestination.java | 2 +-
.../InputDestination.java} | 4 +-
.../OutputDestination.java} | 8 +-
.../SampleStreamApp.java | 10 +-
.../TestChannelBinder.java} | 18 +--
.../TestChannelBinderConfiguration.java} | 28 ++--
.../TestChannelBinderProvisioner.java} | 12 +-
.../stream/binder/test/package-info.java | 28 ++++
.../BindingServiceConfigurationTests.java | 4 +-
17 files changed, 166 insertions(+), 125 deletions(-)
rename spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/{integration => test}/AbstractDestination.java (94%)
rename spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/{integration/SourceDestination.java => test/InputDestination.java} (90%)
rename spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/{integration/TargetDestination.java => test/OutputDestination.java} (85%)
rename spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/{integration => test}/SampleStreamApp.java (90%)
rename spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/{integration/SpringIntegrationChannelBinder.java => test/TestChannelBinder.java} (93%)
rename spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/{integration/SpringIntegrationBinderConfiguration.java => test/TestChannelBinderConfiguration.java} (79%)
rename spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/{integration/SpringIntegrationProvisioner.java => test/TestChannelBinderProvisioner.java} (92%)
create mode 100644 spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/package-info.java
diff --git a/spring-cloud-stream-binder-test/pom.xml b/spring-cloud-stream-binder-test/pom.xml
index d3ebb490b..630e708d8 100644
--- a/spring-cloud-stream-binder-test/pom.xml
+++ b/spring-cloud-stream-binder-test/pom.xml
@@ -38,5 +38,11 @@
spring-boot-starter-test
compile
+
+ org.springframework.cloud
+ spring-cloud-stream
+ test-jar
+ test-binder
+
diff --git a/spring-cloud-stream-integration-tests/pom.xml b/spring-cloud-stream-integration-tests/pom.xml
index c26fb7f4c..81c096c4b 100644
--- a/spring-cloud-stream-integration-tests/pom.xml
+++ b/spring-cloud-stream-integration-tests/pom.xml
@@ -1,5 +1,6 @@
-
+
4.0.0
spring-cloud-stream-integration-tests
@@ -23,6 +24,12 @@
spring-cloud-stream-test-support
test
+
+ org.springframework.cloud
+ spring-cloud-stream
+ test-jar
+ test-binder
+
org.springframework.cloud
spring-cloud-stream-test-support-internal
diff --git a/spring-cloud-stream/pom.xml b/spring-cloud-stream/pom.xml
index a22f4186b..e8d62b9e8 100644
--- a/spring-cloud-stream/pom.xml
+++ b/spring-cloud-stream/pom.xml
@@ -73,7 +73,7 @@
- **/integration/*
+ **/test/*
test-binder
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/AbstractMessageChannelBinderTests.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/AbstractMessageChannelBinderTests.java
index 60234d286..231d055ce 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/AbstractMessageChannelBinderTests.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/AbstractMessageChannelBinderTests.java
@@ -25,7 +25,7 @@ import org.junit.Test;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.cloud.stream.binder.integration.SpringIntegrationBinderConfiguration;
+import org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration;
import org.springframework.cloud.stream.provisioning.ProvisioningProvider;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
@@ -56,7 +56,7 @@ public class AbstractMessageChannelBinderTests {
@Before
public void prepare() {
- this.context = new SpringApplicationBuilder(SpringIntegrationBinderConfiguration.getCompleteConfiguration())
+ this.context = new SpringApplicationBuilder(TestChannelBinderConfiguration.getCompleteConfiguration())
.web(WebApplicationType.NONE)
.run();
}
@@ -107,7 +107,7 @@ public class AbstractMessageChannelBinderTests {
@Test
public void testEndpointBinderHasRecoverer() throws Exception {
ConfigurableApplicationContext context =
- new SpringApplicationBuilder(SpringIntegrationBinderConfiguration.getCompleteConfiguration()).web(WebApplicationType.NONE).run();
+ new SpringApplicationBuilder(TestChannelBinderConfiguration.getCompleteConfiguration()).web(WebApplicationType.NONE).run();
AbstractMessageChannelBinder> binder =
context.getBean(AbstractMessageChannelBinder.class);
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BinderAwareChannelResolverTests.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BinderAwareChannelResolverTests.java
index 5ec4e02a4..5efc7735b 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BinderAwareChannelResolverTests.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BinderAwareChannelResolverTests.java
@@ -30,7 +30,7 @@ import org.mockito.Mockito;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.cloud.stream.binder.integration.SpringIntegrationBinderConfiguration;
+import org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration;
import org.springframework.cloud.stream.binding.Bindable;
import org.springframework.cloud.stream.binding.BinderAwareChannelResolver;
import org.springframework.cloud.stream.binding.BindingService;
@@ -94,7 +94,7 @@ public class BinderAwareChannelResolverTests {
@SuppressWarnings("unchecked")
@Before
public void setupContext() throws Exception {
- this.context = new SpringApplicationBuilder(SpringIntegrationBinderConfiguration.getCompleteConfiguration(BinderAwareChannelResolverTests.InterceptorConfiguration.class))
+ this.context = new SpringApplicationBuilder(TestChannelBinderConfiguration.getCompleteConfiguration(BinderAwareChannelResolverTests.InterceptorConfiguration.class))
.web(WebApplicationType.NONE).run();
this.resolver = context.getBean(BinderAwareChannelResolver.class);
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/PollableConsumerTests.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/PollableConsumerTests.java
index 8462d06ce..f4db36c93 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/PollableConsumerTests.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/PollableConsumerTests.java
@@ -27,8 +27,8 @@ import org.junit.Test;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.cloud.stream.binder.integration.SpringIntegrationBinderConfiguration;
-import org.springframework.cloud.stream.binder.integration.SpringIntegrationChannelBinder;
+import org.springframework.cloud.stream.binder.test.TestChannelBinder;
+import org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration;
import org.springframework.cloud.stream.binding.MessageConverterConfigurer;
import org.springframework.cloud.stream.converter.CompositeMessageConverterFactory;
import org.springframework.context.ApplicationContext;
@@ -66,7 +66,7 @@ public class PollableConsumerTests {
@Test
public void testSimple() {
- SpringIntegrationChannelBinder binder = createBinder();
+ TestChannelBinder binder = createBinder();
MessageConverterConfigurer configurer = context.getBean(MessageConverterConfigurer.class);
DefaultPollableMessageSource pollableSource = new DefaultPollableMessageSource(this.messageConverter);
@@ -98,7 +98,7 @@ public class PollableConsumerTests {
@Test
public void testConvertSimple() {
- SpringIntegrationChannelBinder binder = createBinder();
+ TestChannelBinder binder = createBinder();
MessageConverterConfigurer configurer = context.getBean(MessageConverterConfigurer.class);
binder.setMessageSourceDelegate(() -> new GenericMessage<>("{\"foo\":\"bar\"}".getBytes()));
@@ -125,7 +125,7 @@ public class PollableConsumerTests {
@Test
public void testConvertList() {
- SpringIntegrationChannelBinder binder = createBinder();
+ TestChannelBinder binder = createBinder();
MessageConverterConfigurer configurer = context.getBean(MessageConverterConfigurer.class);
binder.setMessageSourceDelegate(() -> new GenericMessage<>("[{\"foo\":\"bar\"},{\"foo\":\"baz\"}]".getBytes()));
@@ -153,7 +153,7 @@ public class PollableConsumerTests {
@Test
public void testConvertMap() {
- SpringIntegrationChannelBinder binder = createBinder();
+ TestChannelBinder binder = createBinder();
MessageConverterConfigurer configurer = context.getBean(MessageConverterConfigurer.class);
binder.setMessageSourceDelegate(() -> new GenericMessage<>("{\"qux\":{\"foo\":\"bar\"}}".getBytes()));
@@ -176,7 +176,7 @@ public class PollableConsumerTests {
@Test
public void testEmbedded() {
- SpringIntegrationChannelBinder binder = createBinder();
+ TestChannelBinder binder = createBinder();
MessageConverterConfigurer configurer = context.getBean(MessageConverterConfigurer.class);
binder.setMessageSourceDelegate(() -> {
@@ -214,7 +214,7 @@ public class PollableConsumerTests {
@Test
public void testErrors() {
- SpringIntegrationChannelBinder binder = createBinder();
+ TestChannelBinder binder = createBinder();
MessageConverterConfigurer configurer = context.getBean(MessageConverterConfigurer.class);
DefaultPollableMessageSource pollableSource = new DefaultPollableMessageSource(this.messageConverter);
@@ -250,7 +250,7 @@ public class PollableConsumerTests {
@Test
public void testErrorsNoRetry() {
- SpringIntegrationChannelBinder binder = createBinder();
+ TestChannelBinder binder = createBinder();
MessageConverterConfigurer configurer = context.getBean(MessageConverterConfigurer.class);
DefaultPollableMessageSource pollableSource = new DefaultPollableMessageSource(this.messageConverter);
@@ -280,10 +280,10 @@ public class PollableConsumerTests {
assertThat(count.get()).isEqualTo(1);
}
- private SpringIntegrationChannelBinder createBinder() {
- this.context = new SpringApplicationBuilder(SpringIntegrationBinderConfiguration.getCompleteConfiguration())
+ private TestChannelBinder createBinder() {
+ this.context = new SpringApplicationBuilder(TestChannelBinderConfiguration.getCompleteConfiguration())
.web(WebApplicationType.NONE).run();
- SpringIntegrationChannelBinder binder = context.getBean(SpringIntegrationChannelBinder.class);
+ TestChannelBinder binder = context.getBean(TestChannelBinder.class);
return binder;
}
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/SourceBindingWithGlobalPropertiesOnlyTest.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/SourceBindingWithGlobalPropertiesOnlyTest.java
index fa26a1e84..1a01515f6 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/SourceBindingWithGlobalPropertiesOnlyTest.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/SourceBindingWithGlobalPropertiesOnlyTest.java
@@ -24,7 +24,7 @@ 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.binder.integration.SpringIntegrationBinderConfiguration;
+import org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration;
import org.springframework.cloud.stream.config.BindingProperties;
import org.springframework.cloud.stream.config.BindingServiceProperties;
import org.springframework.cloud.stream.messaging.Source;
@@ -35,7 +35,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* @author Ilayaperumal Gopinathan
*/
@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest(classes = {SpringIntegrationBinderConfiguration.class, SourceBindingWithGlobalPropertiesOnlyTest.TestSource.class}, properties = {
+@SpringBootTest(classes = {TestChannelBinderConfiguration.class, SourceBindingWithGlobalPropertiesOnlyTest.TestSource.class}, properties = {
"spring.cloud.stream.default.contentType=application/json",
"spring.cloud.stream.default.producer.partitionKeyExpression=key" })
public class SourceBindingWithGlobalPropertiesOnlyTest {
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/tck/ContentTypeTckTests.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/tck/ContentTypeTckTests.java
index 585e5a374..44c8912c5 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/tck/ContentTypeTckTests.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/tck/ContentTypeTckTests.java
@@ -29,10 +29,10 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.annotation.StreamMessageConverter;
-import org.springframework.cloud.stream.binder.integration.SourceDestination;
-import org.springframework.cloud.stream.binder.integration.SpringIntegrationBinderConfiguration;
-import org.springframework.cloud.stream.binder.integration.SpringIntegrationChannelBinder;
-import org.springframework.cloud.stream.binder.integration.TargetDestination;
+import org.springframework.cloud.stream.binder.test.InputDestination;
+import org.springframework.cloud.stream.binder.test.OutputDestination;
+import org.springframework.cloud.stream.binder.test.TestChannelBinder;
+import org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration;
import org.springframework.cloud.stream.converter.KryoMessageConverter;
import org.springframework.cloud.stream.converter.MessageConverterUtils;
import org.springframework.cloud.stream.messaging.Processor;
@@ -74,8 +74,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(PojoToPojoStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -88,8 +88,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(PojoToStringStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -102,8 +102,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(PojoToStringStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.cloud.stream.bindings.output.contentType=text/plain", "--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -116,8 +116,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(PojoToByteArrayStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -130,8 +130,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(PojoToByteArrayStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.cloud.stream.bindings.output.contentType=text/plain", "--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -144,8 +144,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(StringToPojoStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.cloud.stream.bindings.input.contentType=text/plain", "--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -158,8 +158,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(StringToPojoStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes(), new MessageHeaders(Collections.singletonMap(MessageHeaders.CONTENT_TYPE, MimeTypeUtils.TEXT_PLAIN))));
Message outputMessage = target.receive();
@@ -172,8 +172,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(ByteArrayToPojoStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.cloud.stream.bindings.input.contentType=text/plain", "--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -186,8 +186,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(StringToPojoStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes(), new MessageHeaders(Collections.singletonMap(MessageHeaders.CONTENT_TYPE, MimeTypeUtils.TEXT_PLAIN))));
Message outputMessage = target.receive();
@@ -200,8 +200,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(ByteArrayToByteArrayStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -214,8 +214,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(ByteArrayToByteArrayStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.cloud.stream.bindings.input.contentType=text/plain", "--spring.cloud.stream.bindings.output.contentType=text/plain", "--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -229,8 +229,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(PojoMessageToStringMessageStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -243,8 +243,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(PojoMessageToStringMessageServiceActivator.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -257,8 +257,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(ByteArrayMessageToStringJsonMessageStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -271,8 +271,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(StringMessageToStringMessageStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -285,8 +285,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(PojoToPojoStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.cloud.stream.default.contentType=application/x-java-object", "--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
KryoMessageConverter converter = new KryoMessageConverter(null, true);
@SuppressWarnings("unchecked")
@@ -306,8 +306,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(PojoToPojoStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false", "--spring.cloud.stream.bindings.output.contentType=application/x-java-object");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
KryoMessageConverter converter = new KryoMessageConverter(null, true);
@SuppressWarnings("unchecked")
@@ -330,8 +330,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(StringToStringStreamListener.class, CustomConverters.class)
.web(WebApplicationType.NONE)
.run("--spring.cloud.stream.default.contentType=application/x-java-object", "--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -346,8 +346,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(StringToStringStreamListener.class, CustomConverters.class)
.web(WebApplicationType.NONE)
.run("--spring.cloud.stream.default.contentType=foo/bar", "--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -364,8 +364,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(PojoToPojoStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.cloud.stream.default.contentType=text/plain", "--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- SpringIntegrationChannelBinder binder = context.getBean(SpringIntegrationChannelBinder.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ TestChannelBinder binder = context.getBean(TestChannelBinder.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
assertTrue(binder.getLastError().getPayload() instanceof MessageConversionException);
@@ -376,8 +376,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(StringToStringStreamListener.class)
.web(WebApplicationType.NONE)
.run("--spring.cloud.stream.default.contentType=foo/bar", "--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- SpringIntegrationChannelBinder binder = context.getBean(SpringIntegrationChannelBinder.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ TestChannelBinder binder = context.getBean(TestChannelBinder.class);
String jsonPayload = "{\"name\":\"oleg\"}";
source.send(new GenericMessage(jsonPayload.getBytes()));
assertTrue(binder.getLastError().getPayload() instanceof MessageConversionException);
@@ -389,8 +389,8 @@ public class ContentTypeTckTests {
ApplicationContext context = new SpringApplicationBuilder(CollectionWithParameterizedTypes.class)
.web(WebApplicationType.NONE)
.run("--spring.jmx.enabled=false");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
String jsonPayload = "[{\"person\":{\"name\":\"jon\"},\"id\":123},{\"person\":{\"name\":\"jane\"},\"id\":456}]";
source.send(new GenericMessage(jsonPayload.getBytes()));
Message outputMessage = target.receive();
@@ -398,7 +398,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class CollectionWithParameterizedTypes {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
@@ -409,7 +409,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class TextInJsonOutListener {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
@@ -419,7 +419,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class PojoToPojoStreamListener {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
@@ -429,7 +429,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class PojoToStringStreamListener {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
@@ -439,7 +439,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class PojoToByteArrayStreamListener {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
@@ -449,7 +449,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class ByteArrayToPojoStreamListener {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
@@ -460,7 +460,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class StringToPojoStreamListener {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
@@ -471,7 +471,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class ByteArrayToByteArrayStreamListener {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
@@ -481,7 +481,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class StringToStringStreamListener {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
@@ -491,7 +491,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class PojoMessageToStringMessageStreamListener {
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
@@ -501,7 +501,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class PojoMessageToStringMessageServiceActivator {
@ServiceActivator(inputChannel=Processor.INPUT, outputChannel=Processor.OUTPUT)
public Message echo(Message value) {
@@ -510,7 +510,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class StringMessageToStringMessageStreamListener {
@ServiceActivator(inputChannel=Processor.INPUT, outputChannel=Processor.OUTPUT)
public Message echo(Message value) throws Exception {
@@ -521,7 +521,7 @@ public class ContentTypeTckTests {
}
@EnableBinding(Processor.class)
- @Import(SpringIntegrationBinderConfiguration.class)
+ @Import(TestChannelBinderConfiguration.class)
public static class ByteArrayMessageToStringJsonMessageStreamListener {
@ServiceActivator(inputChannel=Processor.INPUT, outputChannel=Processor.OUTPUT)
public Message echo(Message value) throws Exception {
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/AbstractDestination.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/AbstractDestination.java
similarity index 94%
rename from spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/AbstractDestination.java
rename to spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/AbstractDestination.java
index bbd5ab28d..5b094fe6f 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/AbstractDestination.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/AbstractDestination.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.cloud.stream.binder.integration;
+package org.springframework.cloud.stream.binder.test;
import org.springframework.messaging.SubscribableChannel;
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SourceDestination.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/InputDestination.java
similarity index 90%
rename from spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SourceDestination.java
rename to spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/InputDestination.java
index ddb698e66..ec0523933 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SourceDestination.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/InputDestination.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.cloud.stream.binder.integration;
+package org.springframework.cloud.stream.binder.test;
import org.springframework.messaging.Message;
@@ -27,7 +27,7 @@ import org.springframework.messaging.Message;
* @author Oleg Zhurakousky
*
*/
-public class SourceDestination extends AbstractDestination {
+public class InputDestination extends AbstractDestination {
/**
* Allows the {@link Message} to be sent to a Binder to be delegated
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/TargetDestination.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/OutputDestination.java
similarity index 85%
rename from spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/TargetDestination.java
rename to spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/OutputDestination.java
index 2f104a632..cadc998fc 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/TargetDestination.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/OutputDestination.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.cloud.stream.binder.integration;
+package org.springframework.cloud.stream.binder.test;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedTransferQueue;
@@ -31,12 +31,12 @@ import org.springframework.messaging.Message;
* @author Oleg Zhurakousky
*
*/
-public class TargetDestination extends AbstractDestination {
+public class OutputDestination extends AbstractDestination {
private BlockingQueue> messages;
/**
- * Allows to access {@link Message}s received by this {@link TargetDestination}.
+ * Allows to access {@link Message}s received by this {@link OutputDestination}.
* @param timeout how long to wait before giving up
*/
@SuppressWarnings("unchecked")
@@ -51,7 +51,7 @@ public class TargetDestination extends AbstractDestination {
}
/**
- * Allows to access {@link Message}s received by this {@link TargetDestination}.
+ * Allows to access {@link Message}s received by this {@link OutputDestination}.
*/
public Message receive() {
return this.receive(0);
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SampleStreamApp.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/SampleStreamApp.java
similarity index 90%
rename from spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SampleStreamApp.java
rename to spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/SampleStreamApp.java
index f1388ee1e..d1071babb 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SampleStreamApp.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/SampleStreamApp.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.cloud.stream.binder.integration;
+package org.springframework.cloud.stream.binder.test;
import java.nio.charset.StandardCharsets;
@@ -38,7 +38,7 @@ import org.springframework.messaging.support.GenericMessage;
import static org.junit.Assert.assertEquals;
/**
- * Sample spring cloud stream application that demonstrates the usage of {@link SpringIntegrationChannelBinder}.
+ * Sample spring cloud stream application that demonstrates the usage of {@link TestChannelBinder}.
*
* @author Oleg Zhurakousky
* @author Gary Russell
@@ -46,14 +46,14 @@ import static org.junit.Assert.assertEquals;
*/
@SpringBootApplication
@EnableBinding(SampleStreamApp.PolledConsumer.class)
-@Import(SpringIntegrationBinderConfiguration.class)
+@Import(TestChannelBinderConfiguration.class)
public class SampleStreamApp {
public static void main(String[] args) {
ApplicationContext context = new SpringApplicationBuilder(SampleStreamApp.class).web(WebApplicationType.NONE)
.run("--server.port=0");
- SourceDestination source = context.getBean(SourceDestination.class);
- TargetDestination target = context.getBean(TargetDestination.class);
+ InputDestination source = context.getBean(InputDestination.class);
+ OutputDestination target = context.getBean(OutputDestination.class);
source.send(new GenericMessage("Hello".getBytes()));
Message> message = target.receive();
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SpringIntegrationChannelBinder.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/TestChannelBinder.java
similarity index 93%
rename from spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SpringIntegrationChannelBinder.java
rename to spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/TestChannelBinder.java
index a5d1c210f..6886b7be0 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SpringIntegrationChannelBinder.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/TestChannelBinder.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.cloud.stream.binder.integration;
+package org.springframework.cloud.stream.binder.test;
import java.util.Collections;
import java.util.function.Consumer;
@@ -25,8 +25,8 @@ import org.springframework.cloud.stream.binder.AbstractMessageChannelBinder;
import org.springframework.cloud.stream.binder.Binder;
import org.springframework.cloud.stream.binder.ConsumerProperties;
import org.springframework.cloud.stream.binder.ProducerProperties;
-import org.springframework.cloud.stream.binder.integration.SpringIntegrationProvisioner.SpringIntegrationConsumerDestination;
-import org.springframework.cloud.stream.binder.integration.SpringIntegrationProvisioner.SpringIntegrationProducerDestination;
+import org.springframework.cloud.stream.binder.test.TestChannelBinderProvisioner.SpringIntegrationConsumerDestination;
+import org.springframework.cloud.stream.binder.test.TestChannelBinderProvisioner.SpringIntegrationProducerDestination;
import org.springframework.cloud.stream.provisioning.ConsumerDestination;
import org.springframework.cloud.stream.provisioning.ProducerDestination;
import org.springframework.core.AttributeAccessor;
@@ -61,12 +61,12 @@ import org.springframework.util.StringUtils;
*
* The destination classes are
*
- * - {@link SourceDestination}
- * - {@link TargetDestination}
+ * - {@link InputDestination}
+ * - {@link OutputDestination}
*
* Simply autowire them in your your application and send/receive messages.
*
- * You must also add {@link SpringIntegrationBinderConfiguration} to your configuration.
+ * You must also add {@link TestChannelBinderConfiguration} to your configuration.
* Below is the example using Spring Boot test.
*
*
@@ -101,8 +101,8 @@ import org.springframework.util.StringUtils;
* @author Gary Russell
*
*/
-public class SpringIntegrationChannelBinder extends AbstractMessageChannelBinder {
+public class TestChannelBinder extends AbstractMessageChannelBinder {
@Autowired
private BeanFactory beanFactory;
@@ -112,7 +112,7 @@ public class SpringIntegrationChannelBinder extends AbstractMessageChannelBinder
private MessageSource> messageSourceDelegate = () -> new GenericMessage<>("polled data",
Collections.singletonMap(MessageHeaders.CONTENT_TYPE, "text/plain"));
- public SpringIntegrationChannelBinder(SpringIntegrationProvisioner provisioningProvider) {
+ public TestChannelBinder(TestChannelBinderProvisioner provisioningProvider) {
super(new String[] {}, provisioningProvider);
}
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SpringIntegrationBinderConfiguration.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/TestChannelBinderConfiguration.java
similarity index 79%
rename from spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SpringIntegrationBinderConfiguration.java
rename to spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/TestChannelBinderConfiguration.java
index 98e24b638..82e29edaa 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SpringIntegrationBinderConfiguration.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/TestChannelBinderConfiguration.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.cloud.stream.binder.integration;
+package org.springframework.cloud.stream.binder.test;
import java.util.ArrayList;
import java.util.Arrays;
@@ -39,16 +39,16 @@ import org.springframework.integration.config.EnableIntegration;
/**
* {@link Binder} configuration backed by Spring Integration.
*
- * Please see {@link SpringIntegrationChannelBinder} for more details.
+ * Please see {@link TestChannelBinder} for more details.
*
* @author Oleg Zhurakousky
*
- * @see SpringIntegrationChannelBinder
+ * @see TestChannelBinder
*/
@Configuration
@ConditionalOnMissingBean(Binder.class)
@EnableIntegration
-public class SpringIntegrationBinderConfiguration {
+public class TestChannelBinderConfiguration {
public static final String NAME = "integration";
@@ -61,7 +61,7 @@ public class SpringIntegrationBinderConfiguration {
*/
public static Class>[] getCompleteConfiguration(Class>... additionalConfigurationClasses) {
List> configClasses = new ArrayList<>();
- configClasses.add(SpringIntegrationBinderConfiguration.class);
+ configClasses.add(TestChannelBinderConfiguration.class);
Import annotation = AnnotationUtils.getAnnotation(EnableBinding.class, Import.class);
Map annotationAttributes = AnnotationUtils.getAnnotationAttributes(annotation);
configClasses.addAll(Arrays.asList((Class>[])annotationAttributes.get("value")));
@@ -73,30 +73,30 @@ public class SpringIntegrationBinderConfiguration {
@Bean
public BinderTypeRegistry binderTypeRegistry() {
- BinderType binderType = new BinderType(NAME, new Class[] {SpringIntegrationBinderConfiguration.class});
+ BinderType binderType = new BinderType(NAME, new Class[] {TestChannelBinderConfiguration.class});
BinderTypeRegistry btr = new DefaultBinderTypeRegistry(Collections.singletonMap(NAME, binderType));
return btr;
}
@Bean
- public SourceDestination sourceDestination() {
- return new SourceDestination();
+ public InputDestination sourceDestination() {
+ return new InputDestination();
}
@Bean
- public TargetDestination targetDestination() {
- return new TargetDestination();
+ public OutputDestination targetDestination() {
+ return new OutputDestination();
}
@SuppressWarnings("unchecked")
@Bean
- public Binder springIntegrationChannelBinder(SpringIntegrationProvisioner provisioner) {
- return (Binder) new SpringIntegrationChannelBinder(provisioner);
+ public Binder springIntegrationChannelBinder(TestChannelBinderProvisioner provisioner) {
+ return (Binder) new TestChannelBinder(provisioner);
}
@Bean
- public SpringIntegrationProvisioner springIntegrationProvisioner() {
- return new SpringIntegrationProvisioner();
+ public TestChannelBinderProvisioner springIntegrationProvisioner() {
+ return new TestChannelBinderProvisioner();
}
}
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SpringIntegrationProvisioner.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/TestChannelBinderProvisioner.java
similarity index 92%
rename from spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SpringIntegrationProvisioner.java
rename to spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/TestChannelBinderProvisioner.java
index 35d111fd2..5fc05c112 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/integration/SpringIntegrationProvisioner.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/TestChannelBinderProvisioner.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.cloud.stream.binder.integration;
+package org.springframework.cloud.stream.binder.test;
import java.util.HashMap;
import java.util.Map;
@@ -34,7 +34,7 @@ import org.springframework.messaging.Message;
import org.springframework.messaging.SubscribableChannel;
/**
- * {@link ProvisioningProvider} to support {@link SpringIntegrationChannelBinder}. It
+ * {@link ProvisioningProvider} to support {@link TestChannelBinder}. It
* exists primarily to support {@link AbstractMessageChannel} semantics for creating
* {@link ConsumerDestination} and {@link ProducerDestination}, to interact with this
* {@link Binder}.
@@ -42,21 +42,21 @@ import org.springframework.messaging.SubscribableChannel;
* @author Oleg Zhurakousky
*
*/
-public class SpringIntegrationProvisioner implements ProvisioningProvider {
+public class TestChannelBinderProvisioner implements ProvisioningProvider {
private final Map provisionedDestinations = new HashMap<>();
@Autowired
- private SourceDestination source;
+ private InputDestination source;
@Autowired
- private TargetDestination target;
+ private OutputDestination target;
/**
* Will provision producer destination as an SI {@link PublishSubscribeChannel}.
*
* This provides convenience of registering additional subscriber (handler in the test method)
- * along side of being able to call {@link TargetDestination#receive()} to get a
+ * along side of being able to call {@link OutputDestination#receive()} to get a
* {@link Message} for additional assertions.
*/
@Override
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/package-info.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/package-info.java
new file mode 100644
index 000000000..b4bf3526c
--- /dev/null
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/package-info.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2017 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Provides test channel binder and supporting classes
+ *
+ * THe test binder is backed by Spring Integration framework and is not intended
+ * for uses outside of local testing.
+ *
+ * The test binder implementation - {@link org.springframework.cloud.stream.binder.test.TestChannelBinder}
+ * The test binder configuration - {@link org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration}
+ * The example that shows how to use it - {@link org.springframework.cloud.stream.binder.test.SampleStreamApp}
+ *
+ */
+package org.springframework.cloud.stream.binder.test;
diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/BindingServiceConfigurationTests.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/BindingServiceConfigurationTests.java
index 986418eca..cd6cee7a0 100644
--- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/BindingServiceConfigurationTests.java
+++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/BindingServiceConfigurationTests.java
@@ -22,7 +22,7 @@ import org.junit.Test;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.cloud.stream.binder.integration.SpringIntegrationBinderConfiguration;
+import org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
@@ -40,7 +40,7 @@ public class BindingServiceConfigurationTests {
@Test
public void valdateImportedConfiguartionHandlerPostProcessing() {
- ApplicationContext context = new SpringApplicationBuilder(SpringIntegrationBinderConfiguration.getCompleteConfiguration(RootConfiguration.class)).web(WebApplicationType.NONE).run();
+ ApplicationContext context = new SpringApplicationBuilder(TestChannelBinderConfiguration.getCompleteConfiguration(RootConfiguration.class)).web(WebApplicationType.NONE).run();
Map beansOfType = context.getBeansOfType(AbstractReplyProducingMessageHandler.class);
for (AbstractReplyProducingMessageHandler handler : beansOfType.values()) {
assertTrue(handler.getNotPropagatedHeaders().contains("contentType"));