Skip to content

Commit 3463d4b

Browse files
piotrpdevk-wall
andauthored
refactor: upgrade to testcontainers 2.0.2 (#556)
* build: update to testcontainers 2.0.2 Signed-off-by: Piotr Płaczek <[email protected]> * refactor: remove JUnit 4 use Signed-off-by: Piotr Płaczek <[email protected]> * build: enforce JUnit 4 ban Signed-off-by: Piotr Płaczek <[email protected]> * docs: add entry to CHANGELOG.md Signed-off-by: Piotr Płaczek <[email protected]> * docs: move CHANGELOG.md entry under SNAPSHOT Signed-off-by: Piotr Płaczek <[email protected]> * exclude commons-io from kafka Signed-off-by: Piotr Płaczek <[email protected]> * improve comment explaining why commons-io is excluded. Signed-off-by: Keith Wall <[email protected]> --------- Signed-off-by: Piotr Płaczek <[email protected]> Signed-off-by: Keith Wall <[email protected]> Co-authored-by: Keith Wall <[email protected]>
1 parent 8c23691 commit 3463d4b

File tree

5 files changed

+34
-6
lines changed

5 files changed

+34
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Please enumerate all user-facing changes using format `<githib issue/pr number>:
55
## SNAPSHOT
66

77
* [#550](https://github.com/kroxylicious/kroxylicious-junit5-extension/pull/550): Bump kafka.version from 4.1.0 to 4.1.1
8+
* [#556](https://github.com/kroxylicious/kroxylicious-junit5-extension/pull/556): Upgrade to Testcontainers 2.0.2
89

910
## 0.13.0
1011

impl/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@
5555
</dependency>
5656
<dependency>
5757
<groupId>org.testcontainers</groupId>
58-
<artifactId>kafka</artifactId>
58+
<artifactId>testcontainers-kafka</artifactId>
5959
<scope>test</scope>
6060
</dependency>
6161
<dependency>
6262
<groupId>org.testcontainers</groupId>
63-
<artifactId>junit-jupiter</artifactId>
63+
<artifactId>testcontainers-junit-jupiter</artifactId>
6464
<scope>test</scope>
6565
</dependency>
6666
<dependency>

impl/src/main/java/io/kroxylicious/testing/kafka/common/ScramInitialiser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import io.kroxylicious.testing.kafka.internal.AdminSource;
2121

22-
import static org.junit.Assert.assertTrue;
22+
import static org.junit.jupiter.api.Assertions.assertTrue;
2323

2424
public class ScramInitialiser {
2525

integration-test/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
</dependency>
5353
<dependency>
5454
<groupId>org.testcontainers</groupId>
55-
<artifactId>kafka</artifactId>
55+
<artifactId>testcontainers-kafka</artifactId>
5656
<scope>test</scope>
5757
</dependency>
5858
<dependency>
5959
<groupId>org.testcontainers</groupId>
60-
<artifactId>junit-jupiter</artifactId>
60+
<artifactId>testcontainers-junit-jupiter</artifactId>
6161
<scope>test</scope>
6262
</dependency>
6363
<dependency>

pom.xml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
<junit.version>5.13.4</junit.version>
8989
<kafka.version>4.1.1</kafka.version>
90-
<testcontainers.version>1.21.3</testcontainers.version>
90+
<testcontainers.version>2.0.2</testcontainers.version>
9191
<lombok.version>1.18.42</lombok.version>
9292
<assertj-core.version>3.27.6</assertj-core.version>
9393
<spotbugs-annotations.version>4.9.8</spotbugs-annotations.version>
@@ -169,6 +169,11 @@
169169
<groupId>ch.qos.logback</groupId>
170170
<artifactId>logback-classic</artifactId>
171171
</exclusion>
172+
<!-- Version supplied by Kafka 3.9 and below is incompatible (too old) for Testcontainers 2.0 -->
173+
<exclusion>
174+
<groupId>commons-io</groupId>
175+
<artifactId>commons-io</artifactId>
176+
</exclusion>
172177
</exclusions>
173178
<scope>provided</scope>
174179
</dependency>
@@ -197,6 +202,11 @@
197202
<groupId>ch.qos.logback</groupId>
198203
<artifactId>logback-classic</artifactId>
199204
</exclusion>
205+
<!-- Version supplied by Zookeeper is incompatible (too old) for Testcontainers 2.0 -->
206+
<exclusion>
207+
<groupId>commons-io</groupId>
208+
<artifactId>commons-io</artifactId>
209+
</exclusion>
200210
</exclusions>
201211
<!-- The user needs to provide this dependency only if they wish to use in-VM kafka with a Zookeeper
202212
controller. If they are using in-VM kafka in KRaft node, or container kafka with Zookeeper, it is not
@@ -529,6 +539,23 @@
529539
</rules>
530540
</configuration>
531541
</execution>
542+
<execution>
543+
<!--AssertJ will throw different exceptions than expected when JUnit 4 is on the classpath -->
544+
<!-- See: https://github.com/kroxylicious/kroxylicious/issues/2801-->
545+
<id>ban-junit-4</id>
546+
<goals>
547+
<goal>enforce</goal>
548+
</goals>
549+
<configuration>
550+
<rules>
551+
<bannedDependencies>
552+
<excludes>
553+
<exclude>junit:junit</exclude>
554+
</excludes>
555+
</bannedDependencies>
556+
</rules>
557+
</configuration>
558+
</execution>
532559
</executions>
533560
</plugin>
534561
<plugin>

0 commit comments

Comments
 (0)