Skip to content
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

Allow test classes to provide runtime hints via declarative mechanisms #29455

Closed
wilkinsona opened this issue Nov 9, 2022 · 1 comment
Closed
Assignees
Labels
in: test Issues in the test module theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Nov 9, 2022

Affects: 6.0.0-RC4

There are situations where tests needs to be able to perform reflection that isn't required at runtime. For such tests, it would be useful if the test class itself could contribute reflection hints using the usual mechanisms such as @Reflective, @ImportRuntimeHints, and @RegisterReflectionForBinding.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 9, 2022
@sbrannen sbrannen changed the title Allow tests to provide reflection hints Allow tests to provide reflection hints via declarative mechanisms Nov 9, 2022
@sbrannen sbrannen added in: test Issues in the test module type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 9, 2022
@sbrannen sbrannen changed the title Allow tests to provide reflection hints via declarative mechanisms Allow test classes to provide reflection hints via declarative mechanisms Nov 9, 2022
@sbrannen sbrannen changed the title Allow test classes to provide reflection hints via declarative mechanisms Allow test classes to provide runtime hints via declarative mechanisms Nov 9, 2022
@sbrannen sbrannen added this to the Triage Queue milestone Nov 9, 2022
@sbrannen
Copy link
Member

sbrannen commented Nov 9, 2022

It is possible to register hints for individual test classes via the org.springframework.test.context.aot.TestRuntimeHintsRegistrar SPI; however, that requires that a custom TestRuntimeHintsRegistrar be registered via aot.factories.

So I agree that support for registering hints local to a particular test class (for example, via the aforementioned standard annotations) could be useful.

@sbrannen sbrannen modified the milestones: Triage Queue, 6.0.0 Nov 11, 2022
@sbrannen sbrannen self-assigned this Nov 11, 2022
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Nov 11, 2022
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 theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants