File tree Expand file tree Collapse file tree 8 files changed +14
-18
lines changed
kafka-spring-cloud-sample
src/test/java/com/example/cloudkafkasample
analytics-spring-cloud-streams-kafka-consumer
src/test/java/com/example/analytics
analytics-spring-cloud-streams-kafka-producer
src/test/java/com/example/analytics
spring-modulith-outbox-pattern
src/test/java/com/example/outboxpattern/common Expand file tree Collapse file tree 8 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 5
5
<parent >
6
6
<groupId >org.springframework.boot</groupId >
7
7
<artifactId >spring-boot-starter-parent</artifactId >
8
- <version >3.3.2 </version >
8
+ <version >3.4.0-M1 </version >
9
9
<relativePath /> <!-- lookup parent from repository -->
10
10
</parent >
11
11
<groupId >com.example</groupId >
Original file line number Diff line number Diff line change 6
6
import org .springframework .boot .testcontainers .service .connection .ServiceConnection ;
7
7
import org .springframework .context .annotation .Bean ;
8
8
import org .springframework .test .context .DynamicPropertyRegistry ;
9
- import org .testcontainers .containers .KafkaContainer ;
9
+ import org .testcontainers .kafka .KafkaContainer ;
10
10
import org .testcontainers .utility .DockerImageName ;
11
11
12
12
@ TestConfiguration (proxyBeanMethods = false )
@@ -15,9 +15,7 @@ class TestCloudKafkaSampleApplication {
15
15
@ Bean
16
16
@ ServiceConnection
17
17
KafkaContainer kafkaContainer (DynamicPropertyRegistry dynamicPropertyRegistry ) {
18
- KafkaContainer kafkaContainer = new KafkaContainer (
19
- DockerImageName .parse ("confluentinc/cp-kafka" ).withTag ("7.6.2" ))
20
- .withKraft ()
18
+ KafkaContainer kafkaContainer = new KafkaContainer (DockerImageName .parse ("apache/kafka" ).withTag ("3.7.1" ))
21
19
.withReuse (true );
22
20
dynamicPropertyRegistry .add ("spring.cloud.stream.kafka.binder.brokers" , kafkaContainer ::getBootstrapServers );
23
21
return kafkaContainer ;
Original file line number Diff line number Diff line change 5
5
<parent >
6
6
<groupId >org.springframework.boot</groupId >
7
7
<artifactId >spring-boot-starter-parent</artifactId >
8
- <version >3.3.2 </version >
8
+ <version >3.4.0-M1 </version >
9
9
<relativePath /> <!-- lookup parent from repository -->
10
10
</parent >
11
11
<groupId >com.example</groupId >
Original file line number Diff line number Diff line change 6
6
import org .springframework .boot .testcontainers .service .connection .ServiceConnection ;
7
7
import org .springframework .context .annotation .Bean ;
8
8
import org .springframework .test .context .DynamicPropertyRegistry ;
9
- import org .testcontainers .containers .KafkaContainer ;
9
+ import org .testcontainers .kafka .KafkaContainer ;
10
10
import org .testcontainers .utility .DockerImageName ;
11
11
12
12
@ TestConfiguration (proxyBeanMethods = false )
13
13
public class TestAnalyticsConsumerApplication {
14
14
15
15
private static final DockerImageName KAFKA_IMAGE_NAME =
16
- DockerImageName .parse ("confluentinc/cp- kafka" ).withTag ("7.6.2 " );
16
+ DockerImageName .parse ("apache/ kafka" ).withTag ("3.7.1 " );
17
17
18
18
@ Bean
19
19
@ ServiceConnection
20
20
KafkaContainer kafkaContainer (DynamicPropertyRegistry registry ) {
21
- KafkaContainer kafkaContainer = new KafkaContainer (KAFKA_IMAGE_NAME ). withKraft () ;
21
+ KafkaContainer kafkaContainer = new KafkaContainer (KAFKA_IMAGE_NAME );
22
22
registry .add ("spring.kafka.bootstrap-servers" , kafkaContainer ::getBootstrapServers );
23
23
return kafkaContainer ;
24
24
}
Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<groupId >org.springframework.boot</groupId >
8
8
<artifactId >spring-boot-starter-parent</artifactId >
9
- <version >3.3.2 </version >
9
+ <version >3.4.0-M1 </version >
10
10
<relativePath /> <!-- lookup parent from repository -->
11
11
</parent >
12
12
Original file line number Diff line number Diff line change 6
6
import org .springframework .boot .testcontainers .service .connection .ServiceConnection ;
7
7
import org .springframework .context .annotation .Bean ;
8
8
import org .springframework .test .context .DynamicPropertyRegistry ;
9
- import org .testcontainers .containers .KafkaContainer ;
9
+ import org .testcontainers .kafka .KafkaContainer ;
10
10
import org .testcontainers .utility .DockerImageName ;
11
11
12
12
@ TestConfiguration (proxyBeanMethods = false )
@@ -16,8 +16,7 @@ class TestAnalyticsProducerApplication {
16
16
@ ServiceConnection
17
17
KafkaContainer kafkaContainer (DynamicPropertyRegistry propertyRegistry ) {
18
18
KafkaContainer kafkaContainer =
19
- new KafkaContainer (DockerImageName .parse ("confluentinc/cp-kafka" ).withTag ("7.6.2" ))
20
- .withKraft ();
19
+ new KafkaContainer (DockerImageName .parse ("apache/kafka" ).withTag ("3.7.1" ));
21
20
propertyRegistry .add ("spring.kafka.bootstrapServers" , kafkaContainer ::getBootstrapServers );
22
21
return kafkaContainer ;
23
22
}
Original file line number Diff line number Diff line change 7
7
<parent >
8
8
<groupId >org.springframework.boot</groupId >
9
9
<artifactId >spring-boot-starter-parent</artifactId >
10
- <version >3.3.2 </version >
10
+ <version >3.4.0-M1 </version >
11
11
<relativePath /> <!-- lookup parent from repository -->
12
12
</parent >
13
13
<groupId >com.example.outboxpattern</groupId >
Original file line number Diff line number Diff line change 5
5
import org .springframework .context .annotation .Bean ;
6
6
import org .springframework .test .context .DynamicPropertyRegistry ;
7
7
import org .testcontainers .containers .GenericContainer ;
8
- import org .testcontainers .containers .KafkaContainer ;
9
8
import org .testcontainers .containers .PostgreSQLContainer ;
9
+ import org .testcontainers .kafka .KafkaContainer ;
10
10
import org .testcontainers .utility .DockerImageName ;
11
11
12
12
@ TestConfiguration (proxyBeanMethods = false )
@@ -21,9 +21,8 @@ PostgreSQLContainer<?> postgreSQLContainer() {
21
21
@ Bean
22
22
@ ServiceConnection
23
23
KafkaContainer kafkaContainer (DynamicPropertyRegistry dynamicPropertyRegistry ) {
24
- KafkaContainer kafkaContainer = new KafkaContainer (
25
- DockerImageName .parse ("confluentinc/cp-kafka" ).withTag ("7.6.2" ))
26
- .withKraft ();
24
+ KafkaContainer kafkaContainer =
25
+ new KafkaContainer (DockerImageName .parse ("apache/kafka" ).withTag ("3.7.1" ));
27
26
// Connect our Spring application to our Testcontainers Kafka instance
28
27
dynamicPropertyRegistry .add ("spring.kafka.consumer.bootstrap-servers" , kafkaContainer ::getBootstrapServers );
29
28
dynamicPropertyRegistry .add ("spring.kafka.producer.bootstrap-servers" , kafkaContainer ::getBootstrapServers );
You can’t perform that action at this time.
0 commit comments