Skip to content

Commit b837bb1

Browse files
authored
Spock Testcontainers annotation is now inherited (#4053)
1 parent bfd61d7 commit b837bb1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

modules/spock/src/main/groovy/org/testcontainers/spock/Testcontainers.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ package org.testcontainers.spock
33
import org.spockframework.runtime.extension.ExtensionAnnotation
44

55
import java.lang.annotation.ElementType
6+
import java.lang.annotation.Inherited
67
import java.lang.annotation.Retention
78
import java.lang.annotation.RetentionPolicy
89
import java.lang.annotation.Target
910

11+
@Inherited
1012
@Retention(RetentionPolicy.RUNTIME)
1113
@Target([ElementType.TYPE, ElementType.METHOD])
1214
@ExtensionAnnotation(TestcontainersExtension)
1315
@interface Testcontainers {
1416

15-
}
17+
}

modules/spock/src/test/groovy/org/testcontainers/spock/TestHierarchyIT.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import org.testcontainers.containers.PostgreSQLContainer
44
import spock.lang.Shared
55

66
/**
7-
* This test verifies that integration tests can subclass each other
7+
* This test verifies that integration tests can subclass each other.
8+
* Also verifies that the @Testcontainers annotation is inherited.
89
*/
9-
@Testcontainers
1010
class TestHierarchyIT extends MySqlContainerIT {
1111

1212
@Shared

0 commit comments

Comments
 (0)