Skip to content

Support test annotations on interfaces [SPR-14184] #18755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
13 of 14 tasks
spring-projects-issues opened this issue Apr 17, 2016 · 1 comment
Closed
13 of 14 tasks

Support test annotations on interfaces [SPR-14184] #18755

spring-projects-issues opened this issue Apr 17, 2016 · 1 comment
Assignees
Labels
in: test Issues in the test module type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Apr 17, 2016

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.

  1. @ActiveProfiles
    • see ActiveProfilesInterfaceTests
  2. @BootstrapWith
    • see BootstrapWithInterfaceTests
  3. @ContextConfiguration
    • see ContextConfigurationInterfaceTests
  4. @ContextHierarchy
    • see ContextHierarchyInterfaceTests
  5. @WebAppConfiguration
    • see WebAppConfigurationInterfaceTests
  6. @DirtiesContext
    • see DirtiesContextInterfaceTests
  7. @TestExecutionListeners
    • see customListenersDeclaredOnInterface() in TestExecutionListenersTests
  8. @TestPropertySource
    • see TestPropertySourceInterfaceTests
  9. @Sql and @SqlGroup
  10. @SqlConfig
    • see SqlConfigInterfaceTests
  11. @Commit
    • see TransactionalTestExecutionListenerTests
  12. @Rollback
    • see TransactionalTestExecutionListenerTests
  13. @IfProfileValue
    • see DisabledAnnotatedSingleValueOnTestInterface in ProfileValueUtilsTests
  14. @ProfileValueSourceConfiguration
    • see EnabledWithCustomProfileValueSourceOnTestInterface in ProfileValueUtilsTests

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

Completed in GitHub commit a1a8767.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants