Verifies five claims against primary sources rather than release-note prose: the org.testcontainers:junit-jupiter -> testcontainers-junit-jupiter rename (and the other 60 like it, per OpenRewrite's own Testcontainers2Migration recipe), that GenericContainer no longer implements org.junit.rules.TestRule anywhere in the 2.0.5 jar (confirmed exhaustively, not just for this one class), the real compiler/dependency-resolution breaks from bumping only a version number on existing JUnit 4 @ClassRule code, the literal 1.32 -> 1.44 default Docker API version bump in DockerClientProviderStrategy's bytecode (tied to the real Docker Engine 29 compatibility issue), and Spring Boot 4.1.1's BOM pinning 2.0.5. Built and tested with no Docker daemon available; one test class demonstrates a clean @EnabledIfDockerAvailable skip, guarded at the class level after the method-level guard was caught failing first.
49 lines
2.5 KiB
Plaintext
49 lines
2.5 KiB
Plaintext
# unzipped from testcontainers-1.21.4.jar
|
|
$ javap -p org/testcontainers/containers/GenericContainer.class
|
|
public class org.testcontainers.containers.GenericContainer<SELF extends org.testcontainers.containers.GenericContainer<SELF>>
|
|
extends org.testcontainers.containers.FailureDetectingExternalResource
|
|
implements org.testcontainers.containers.Container<SELF>, java.lang.AutoCloseable,
|
|
org.testcontainers.containers.wait.strategy.WaitStrategyTarget,
|
|
org.testcontainers.lifecycle.Startable {
|
|
...
|
|
}
|
|
|
|
$ javap -p org/testcontainers/containers/FailureDetectingExternalResource.class
|
|
public class org.testcontainers.containers.FailureDetectingExternalResource
|
|
implements org.junit.rules.TestRule {
|
|
public org.testcontainers.containers.FailureDetectingExternalResource();
|
|
...
|
|
}
|
|
|
|
# So in 1.21.4: GenericContainer -> FailureDetectingExternalResource -> implements TestRule.
|
|
# Every container class is a JUnit 4 TestRule by inheritance, with no extra dependency.
|
|
|
|
# unzipped from testcontainers-2.0.5.jar instead
|
|
$ javap -p org/testcontainers/containers/GenericContainer.class
|
|
public class org.testcontainers.containers.GenericContainer<SELF extends org.testcontainers.containers.GenericContainer<SELF>>
|
|
implements org.testcontainers.containers.Container<SELF>, java.lang.AutoCloseable,
|
|
org.testcontainers.containers.wait.strategy.WaitStrategyTarget,
|
|
org.testcontainers.lifecycle.Startable {
|
|
...
|
|
}
|
|
|
|
# No "extends FailureDetectingExternalResource" at all - that class and the TestRule contract
|
|
# it carried are both gone from the 2.0.5 jar. Confirmed exhaustively, not just for this one
|
|
# class:
|
|
|
|
$ mkdir ext2 && cd ext2 && unzip -oq ../testcontainers-2.0.5.jar
|
|
$ grep -rl "org/junit/rules/TestRule" . --include="*.class" | wc -l
|
|
0
|
|
|
|
# Compare: the same search against the 1.21.4 jar
|
|
$ mkdir ext1 && cd ext1 && unzip -oq ../testcontainers-1.21.4.jar
|
|
$ grep -rl "org/junit/rules/TestRule" . --include="*.class" | wc -l
|
|
2
|
|
|
|
# Zero classes anywhere in the 2.0.5 core jar reference org.junit.rules.TestRule. This is not a
|
|
# deprecation - the interface implementation is physically absent from the compiled jar. It is
|
|
# also why the fix is not "add the testcontainers-junit-jupiter dependency": that artifact is a
|
|
# JUnit 5 extension (@Testcontainers/@Container), not a JUnit 4 rule shim. There is no JUnit 4
|
|
# path forward in 2.0 - see GitHub release notes, testcontainers-java#10805 "Remove JUnit 4
|
|
# support" and #10808 "Fix missing junit4 leftovers", https://github.com/testcontainers/testcontainers-java/releases/tag/2.0.0
|