From 2447a16dbe00ead1f36562cbf637712e3a8207c2 Mon Sep 17 00:00:00 2001 From: Marius Bogoevici Date: Wed, 17 Aug 2016 14:51:10 -0400 Subject: [PATCH] Use Spring Cloud Stream Parent directly Since the intent for `spring-cloud-stream-dependencies` to become the user-facing dependency management BOM, binder implementations should switch to the Spring Cloud Stream parent for version management. This also ensures that they inherit the build lifecycle of Spring Cloud Stream - e.g. checkstyle validation. --- pom.xml | 15 ++------------- .../test/junit/kafka/EmbeddedZookeeper.java | 6 +++--- .../binder/test/junit/kafka/TestKafkaCluster.java | 8 ++++---- .../stream/binder/kafka/KafkaBinderTests.java | 13 ++++++------- .../stream/binder/kafka/KafkaTestBinder.java | 6 +++--- 5 files changed, 18 insertions(+), 30 deletions(-) diff --git a/pom.xml b/pom.xml index 6c4c210e4..9c80ae844 100644 --- a/pom.xml +++ b/pom.xml @@ -6,25 +6,14 @@ pom org.springframework.cloud - spring-cloud-build - 1.1.2.BUILD-SNAPSHOT + spring-cloud-stream-parent + 1.1.0.BUILD-SNAPSHOT 1.7 1.4.0.BUILD-SNAPSHOT - - - - org.springframework.cloud - spring-cloud-stream-dependencies - 1.1.0.BUILD-SNAPSHOT - pom - import - - - spring-cloud-stream-binder-kafka spring-cloud-starter-stream-kafka diff --git a/spring-cloud-stream-binder-kafka-test-support/src/main/java/org/springframework/cloud/stream/binder/test/junit/kafka/EmbeddedZookeeper.java b/spring-cloud-stream-binder-kafka-test-support/src/main/java/org/springframework/cloud/stream/binder/test/junit/kafka/EmbeddedZookeeper.java index edc7e2cf5..a3921b3eb 100644 --- a/spring-cloud-stream-binder-kafka-test-support/src/main/java/org/springframework/cloud/stream/binder/test/junit/kafka/EmbeddedZookeeper.java +++ b/spring-cloud-stream-binder-kafka-test-support/src/main/java/org/springframework/cloud/stream/binder/test/junit/kafka/EmbeddedZookeeper.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.cloud.stream.binder.test.junit.kafka; import java.io.File; import java.net.InetSocketAddress; -import org.apache.zookeeper.server.NIOServerCnxnFactory; -import org.apache.zookeeper.server.ZooKeeperServer; - import kafka.utils.TestUtils$; import kafka.utils.Utils$; +import org.apache.zookeeper.server.NIOServerCnxnFactory; +import org.apache.zookeeper.server.ZooKeeperServer; /** * A port of kafka.zk.EmbeddedZookeeper, compatible with Zookeeper 3.4 API diff --git a/spring-cloud-stream-binder-kafka-test-support/src/main/java/org/springframework/cloud/stream/binder/test/junit/kafka/TestKafkaCluster.java b/spring-cloud-stream-binder-kafka-test-support/src/main/java/org/springframework/cloud/stream/binder/test/junit/kafka/TestKafkaCluster.java index e11aa6c95..e088e6cdf 100644 --- a/spring-cloud-stream-binder-kafka-test-support/src/main/java/org/springframework/cloud/stream/binder/test/junit/kafka/TestKafkaCluster.java +++ b/spring-cloud-stream-binder-kafka-test-support/src/main/java/org/springframework/cloud/stream/binder/test/junit/kafka/TestKafkaCluster.java @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.cloud.stream.binder.test.junit.kafka; import java.io.IOException; import java.util.Properties; -import org.apache.curator.test.TestingServer; - -import org.springframework.util.SocketUtils; - import kafka.server.KafkaConfig; import kafka.server.KafkaServerStartable; import kafka.utils.TestUtils; +import org.apache.curator.test.TestingServer; + +import org.springframework.util.SocketUtils; /** * A test Kafka + ZooKeeper pair for testing purposes. diff --git a/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/KafkaBinderTests.java b/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/KafkaBinderTests.java index 3c90f376c..e15116e7c 100644 --- a/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/KafkaBinderTests.java +++ b/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/KafkaBinderTests.java @@ -16,9 +16,6 @@ package org.springframework.cloud.stream.binder.kafka; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.fail; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -31,6 +28,10 @@ import java.util.UUID; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import kafka.admin.AdminUtils; +import kafka.api.TopicMetadata; +import kafka.utils.ZKStringSerializer$; +import kafka.utils.ZkUtils; import org.I0Itec.zkclient.ZkClient; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.common.PartitionInfo; @@ -75,10 +76,8 @@ import org.springframework.retry.backoff.FixedBackOffPolicy; import org.springframework.retry.policy.SimpleRetryPolicy; import org.springframework.retry.support.RetryTemplate; -import kafka.admin.AdminUtils; -import kafka.api.TopicMetadata; -import kafka.utils.ZKStringSerializer$; -import kafka.utils.ZkUtils; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; /** * Integration tests for the {@link KafkaMessageChannelBinder}. diff --git a/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/KafkaTestBinder.java b/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/KafkaTestBinder.java index 69d9af362..59070df18 100644 --- a/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/KafkaTestBinder.java +++ b/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/KafkaTestBinder.java @@ -18,6 +18,9 @@ package org.springframework.cloud.stream.binder.kafka; import java.util.List; +import com.esotericsoftware.kryo.Kryo; +import com.esotericsoftware.kryo.Registration; + import org.springframework.cloud.stream.binder.AbstractTestBinder; import org.springframework.cloud.stream.binder.ExtendedConsumerProperties; import org.springframework.cloud.stream.binder.ExtendedProducerProperties; @@ -31,9 +34,6 @@ import org.springframework.integration.tuple.TupleKryoRegistrar; import org.springframework.kafka.support.LoggingProducerListener; import org.springframework.kafka.support.ProducerListener; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Registration; - /** * Test support class for {@link KafkaMessageChannelBinder}. Creates a binder that uses a * test {@link TestKafkaCluster kafka cluster}.