Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.junit.jupiter.api.extension.ExtendWith;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
Expand All @@ -18,6 +19,10 @@
* last test method has executed. Containers declared as instance fields will
* be started and stopped for every test method.</p>
*
* <p>The annotation {@code @Testcontainers} can be used on a superclass in
* the test hierarchy as well. All subclasses will automatically inherit
* support for the extension.</p>
*
* <p><strong>Note:</strong> This extension has only be tested with sequential
* test execution. Using it with parallel test execution is unsupported and
* may have unintended side effects.</p>
Expand Down Expand Up @@ -52,6 +57,7 @@
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@ExtendWith(TestcontainersExtension.class)
@Inherited
public @interface Testcontainers {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.util.concurrent.atomic.AtomicLong;

@Testcontainers
abstract class AbstractTestBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

@Testcontainers
class InheritedTests extends AbstractTestBase {

@Container
Expand Down