File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
modules/junit-jupiter/src
main/java/org/testcontainers/junit/jupiter
test/java/org/testcontainers/junit/jupiter/inheritance Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 33import org .junit .jupiter .api .extension .ExtendWith ;
44
55import java .lang .annotation .ElementType ;
6+ import java .lang .annotation .Inherited ;
67import java .lang .annotation .Retention ;
78import java .lang .annotation .RetentionPolicy ;
89import java .lang .annotation .Target ;
1819 * last test method has executed. Containers declared as instance fields will
1920 * be started and stopped for every test method.</p>
2021 *
22+ * <p>The annotation {@code @Testcontainers} can be used on a superclass in
23+ * the test hierarchy as well. All subclasses will automatically inherit
24+ * support for the extension.</p>
25+ *
2126 * <p><strong>Note:</strong> This extension has only be tested with sequential
2227 * test execution. Using it with parallel test execution is unsupported and
2328 * may have unintended side effects.</p>
5257@ Target (ElementType .TYPE )
5358@ Retention (RetentionPolicy .RUNTIME )
5459@ ExtendWith (TestcontainersExtension .class )
60+ @ Inherited
5561public @interface Testcontainers {
5662
5763 /**
Original file line number Diff line number Diff line change 33import org .testcontainers .junit .jupiter .Container ;
44import org .testcontainers .junit .jupiter .Testcontainers ;
55
6- import java .util .concurrent .atomic .AtomicLong ;
7-
86@ Testcontainers
97abstract class AbstractTestBase {
108
Original file line number Diff line number Diff line change 66
77import static org .junit .jupiter .api .Assertions .assertEquals ;
88
9- @ Testcontainers
109class InheritedTests extends AbstractTestBase {
1110
1211 @ Container
You can’t perform that action at this time.
0 commit comments