Skip to content

Commit

Permalink
Merge pull request #10597 from richersoon/switch-to-Kafka-native-image
Browse files Browse the repository at this point in the history
Switch to Kafka native image in KafkaTestContainer
  • Loading branch information
murdos authored Aug 18, 2024
2 parents 2af8b9f + c464493 commit e622287
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public JHipsterModule buildModuleInit(JHipsterModuleProperties properties) {
//@formatter:off
return moduleBuilder(properties)
.context()
.put("kafkaDockerImage", dockerImages.get("apache/kafka").fullName())
.put("kafkaDockerImage", dockerImages.get("apache/kafka-native").fullName())
.put("kafkaClusterId", kafkaClusterId)
.and()
.documentation(documentationTitle("Apache Kafka"), SOURCE.template("apache-kafka.md"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/generator/dependencies/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM mysql:9.0.1
FROM cassandra:4.1.5
FROM mcr.microsoft.com/mssql/server:2022-latest
FROM postgres:16.4
FROM apache/kafka:3.8.0
FROM apache/kafka-native:3.8.0
FROM tchiotludo/akhq:0.25.1
FROM apachepulsar/pulsar:3.3.1
FROM neo4j:5.22.0-community
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class KafkaModuleFactoryTest {

@Test
void shouldBuildKafkaModuleInit() {
when(dockerImages.get("apache/kafka")).thenReturn(new DockerImageVersion("apache/kafka", "1.0.0"));
when(dockerImages.get("apache/kafka-native")).thenReturn(new DockerImageVersion("apache/kafka-native", "1.0.0"));

JHipsterModuleProperties properties = JHipsterModulesFixture.propertiesBuilder(tmpDirForTest())
.basePackage("tech.jhipster.jhlitest")
Expand All @@ -52,6 +52,7 @@ void shouldBuildKafkaModuleInit() {
.containing("<artifactId>kafka</artifactId>")
.and()
.hasFile("src/main/docker/kafka.yml")
.containing("image: apache/kafka-native")
.containing("CLUSTER_ID: 'my-cluster'")
.and()
.hasFile("src/main/resources/config/application.yml")
Expand Down Expand Up @@ -81,6 +82,7 @@ void shouldBuildKafkaModuleInit() {
)
.and()
.hasFile("src/test/java/tech/jhipster/jhlitest/KafkaTestContainerExtension.java")
.containing("apache/kafka-native")
.and()
.hasFile("src/test/java/tech/jhipster/jhlitest/IntegrationTest.java")
.containing("@ExtendWith(KafkaTestContainerExtension.class)")
Expand Down

0 comments on commit e622287

Please sign in to comment.