Skip to content

Commit 3d785ff

Browse files
committed
Updated versions and re-enabled kafka test
1 parent 6752679 commit 3d785ff

File tree

5 files changed

+20
-23
lines changed

5 files changed

+20
-23
lines changed

spring-cloud-starter-single-step-batch-job/pom.xml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@
1010
<artifactId>spring-cloud-starter-single-step-batch-job</artifactId>
1111

1212
<properties>
13-
<test.containers.version>1.15.3</test.containers.version>
14-
<test.rabbit.containers.version>1.15.3</test.rabbit.containers.version>
13+
<test.containers.version>1.16.0</test.containers.version>
14+
<test.rabbit.containers.version>1.16.0</test.rabbit.containers.version>
1515
<test.ducttape.version>1.0.8</test.ducttape.version>
16-
<spring-kafka-version>2.8.0-RC1</spring-kafka-version>
17-
<spring-cloud-stream.version>3.2.0-SNAPSHOT</spring-cloud-stream.version>
1816
</properties>
1917

2018
<dependencies>
@@ -83,11 +81,6 @@
8381
<groupId>com.fasterxml.jackson.core</groupId>
8482
<artifactId>jackson-annotations</artifactId>
8583
</dependency>
86-
<dependency>
87-
<groupId>org.springframework.cloud</groupId>
88-
<artifactId>spring-cloud-stream-binder-kafka</artifactId>
89-
<version>${spring-cloud-stream.version}</version>
90-
</dependency>
9184
<dependency>
9285
<groupId>org.junit.jupiter</groupId>
9386
<artifactId>junit-jupiter</artifactId>
@@ -106,13 +99,11 @@
10699
<dependency>
107100
<groupId>org.springframework.kafka</groupId>
108101
<artifactId>spring-kafka-test</artifactId>
109-
<version>${spring-kafka-version}</version>
110102
<scope>test</scope>
111103
</dependency>
112104
<dependency>
113105
<groupId>org.springframework.kafka</groupId>
114106
<artifactId>spring-kafka</artifactId>
115-
<version>${spring-kafka-version}</version>
116107
</dependency>
117108
<dependency>
118109
<groupId>org.junit.jupiter</groupId>

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/kafka/KafkaItemReaderAutoConfigurationTests.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import org.apache.kafka.clients.producer.Producer;
2727
import org.apache.kafka.clients.producer.ProducerRecord;
2828
import org.apache.kafka.common.serialization.StringSerializer;
29+
import org.junit.jupiter.api.BeforeAll;
30+
import org.junit.jupiter.api.Test;
2931

3032
import org.springframework.batch.core.Job;
3133
import org.springframework.batch.core.JobExecution;
@@ -45,24 +47,25 @@
4547
import org.springframework.kafka.support.serializer.JsonDeserializer;
4648
import org.springframework.kafka.support.serializer.JsonSerializer;
4749
import org.springframework.kafka.test.EmbeddedKafkaBroker;
50+
import org.springframework.kafka.test.context.EmbeddedKafka;
4851
import org.springframework.kafka.test.utils.KafkaTestUtils;
4952

5053
import static org.assertj.core.api.Assertions.assertThat;
5154

52-
//@EmbeddedKafka(partitions = 1, topics = { "test" })
55+
@EmbeddedKafka(partitions = 1, topics = { "test" })
5356
public class KafkaItemReaderAutoConfigurationTests {
5457

5558
private static EmbeddedKafkaBroker embeddedKafkaBroker;
5659

57-
// @BeforeAll
60+
@BeforeAll
5861
public static void setupTest(EmbeddedKafkaBroker embeddedKafka) {
5962
embeddedKafkaBroker = embeddedKafka;
6063
embeddedKafka.addTopics(new NewTopic("topic1", 1, (short) 1),
6164
new NewTopic("topic2", 2, (short) 1),
6265
new NewTopic("topic3", 1, (short) 1));
6366
}
6467

65-
// @Test
68+
@Test
6669
public void testBaseKafkaItemReader() {
6770
final String topicName = "topic1";
6871
populateSingleTopic(topicName);
@@ -109,7 +112,7 @@ public void testBaseKafkaItemReader() {
109112
});
110113
}
111114

112-
// @Test
115+
@Test
113116
public void testBaseKafkaItemReaderMultiplePartitions() {
114117
final String topicName = "topic2";
115118
populateSingleTopic(topicName);
@@ -151,7 +154,7 @@ public void testBaseKafkaItemReaderMultiplePartitions() {
151154
});
152155
}
153156

154-
// @Test
157+
@Test
155158
public void testBaseKafkaItemReaderPollTimeoutDefault() {
156159
final String topicName = "topic3";
157160
populateSingleTopic(topicName);

spring-cloud-starter-single-step-batch-job/src/test/java/org/springframework/cloud/task/batch/autoconfigure/kafka/KafkaItemWriterTests.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import org.apache.kafka.clients.consumer.Consumer;
2525
import org.apache.kafka.clients.consumer.ConsumerRecords;
2626
import org.apache.kafka.common.serialization.StringDeserializer;
27+
import org.junit.jupiter.api.BeforeAll;
28+
import org.junit.jupiter.api.Test;
2729

2830
import org.springframework.batch.core.Job;
2931
import org.springframework.batch.core.JobExecution;
@@ -43,23 +45,24 @@
4345
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
4446
import org.springframework.kafka.support.serializer.JsonDeserializer;
4547
import org.springframework.kafka.test.EmbeddedKafkaBroker;
48+
import org.springframework.kafka.test.context.EmbeddedKafka;
4649
import org.springframework.kafka.test.utils.KafkaTestUtils;
4750

4851
import static java.util.Collections.singleton;
4952
import static org.assertj.core.api.Assertions.assertThat;
5053

51-
// @EmbeddedKafka(partitions = 1, topics = { "topic1" })
54+
@EmbeddedKafka(partitions = 1, topics = { "topic1" })
5255
public class KafkaItemWriterTests {
5356

5457
private static EmbeddedKafkaBroker embeddedKafkaBroker;
5558

56-
// @BeforeAll
59+
@BeforeAll
5760
public static void setupTest(EmbeddedKafkaBroker embeddedKafka) {
5861
embeddedKafkaBroker = embeddedKafka;
5962
embeddedKafka.addTopics("topic2");
6063
}
6164

62-
// @Test
65+
@Test
6366
public void testBaseKafkaItemWriter() {
6467
final String topicName = "topic1";
6568
ApplicationContextRunner applicationContextRunner = new ApplicationContextRunner()

spring-cloud-task-integration-tests/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<artifactId>spring-cloud-task-integration-tests</artifactId>
1414

1515
<properties>
16-
<test.containers.version>1.15.3</test.containers.version>
17-
<test.rabbit.containers.version>1.15.3</test.rabbit.containers.version>
16+
<test.containers.version>1.16.0</test.containers.version>
17+
<test.rabbit.containers.version>1.16.0</test.rabbit.containers.version>
1818
<test.ducttape.version>1.0.8</test.ducttape.version>
1919
</properties>
2020

spring-cloud-task-samples/batch-events/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<properties>
2121
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2222
<java.version>1.8</java.version>
23-
<test.containers.version>1.15.3</test.containers.version>
24-
<test.rabbit.containers.version>1.15.3</test.rabbit.containers.version>
23+
<test.containers.version>1.16.0</test.containers.version>
24+
<test.rabbit.containers.version>1.16.0</test.rabbit.containers.version>
2525
<test.ducttape.version>1.0.8</test.ducttape.version>
2626
<spring.cloud.stream>3.2.0-SNAPSHOT</spring.cloud.stream>
2727
</properties>

0 commit comments

Comments
 (0)