You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to Java 8 it never really made much sense to author integration tests using interfaces. Consequently, the Spring TestContext Framework has never supported finding test-related annotations on interfaces in its search algorithms.
However, Java 8's support for interface default methods introduces new testing use cases for which it makes sense to declare test configuration (e.g., @ContextConfiguration, etc.) on an interface containing default methods instead of on an abstract base class.
Deliverables
For each of the following annotations, implement and test support for declaration on test interfaces.
@ActiveProfiles
see ActiveProfilesInterfaceTests
@BootstrapWith
see BootstrapWithInterfaceTests
@ContextConfiguration
see ContextConfigurationInterfaceTests
@ContextHierarchy
see ContextHierarchyInterfaceTests
@WebAppConfiguration
see WebAppConfigurationInterfaceTests
@DirtiesContext
see DirtiesContextInterfaceTests
@TestExecutionListeners
see customListenersDeclaredOnInterface() in TestExecutionListenersTests
Sam Brannen opened SPR-14184 and commented
Status Quo
Prior to Java 8 it never really made much sense to author integration tests using interfaces. Consequently, the Spring TestContext Framework has never supported finding test-related annotations on interfaces in its search algorithms.
However, Java 8's support for interface default methods introduces new testing use cases for which it makes sense to declare test configuration (e.g.,
@ContextConfiguration
, etc.) on an interface containing default methods instead of on an abstract base class.Deliverables
For each of the following annotations, implement and test support for declaration on test interfaces.
@ActiveProfiles
ActiveProfilesInterfaceTests
@BootstrapWith
BootstrapWithInterfaceTests
@ContextConfiguration
ContextConfigurationInterfaceTests
@ContextHierarchy
ContextHierarchyInterfaceTests
@WebAppConfiguration
WebAppConfigurationInterfaceTests
@DirtiesContext
DirtiesContextInterfaceTests
@TestExecutionListeners
customListenersDeclaredOnInterface()
inTestExecutionListenersTests
@TestPropertySource
TestPropertySourceInterfaceTests
@Sql
and@SqlGroup
@Sql
annotations on test interfaces #18827@SqlConfig
SqlConfigInterfaceTests
@Commit
TransactionalTestExecutionListenerTests
@Rollback
TransactionalTestExecutionListenerTests
@IfProfileValue
DisabledAnnotatedSingleValueOnTestInterface
inProfileValueUtilsTests
@ProfileValueSourceConfiguration
EnabledWithCustomProfileValueSourceOnTestInterface
inProfileValueUtilsTests
Issue Links:
@BeforeTransaction
and@AfterTransaction
on interface default methods@Sql
annotations on test interfaces #18827 Support@Sql
and@SqlGroup
on test interfacesThe text was updated successfully, but these errors were encountered: