# unzipped from testcontainers-1.21.4.jar $ javap -p org/testcontainers/containers/GenericContainer.class public class org.testcontainers.containers.GenericContainer> extends org.testcontainers.containers.FailureDetectingExternalResource implements org.testcontainers.containers.Container, 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> implements org.testcontainers.containers.Container, 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