-
Notifications
You must be signed in to change notification settings - Fork 353
Support "args" param in "@SpringBootTest" #1447
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @ttddyy. This is an interesting approach but I'd rather compute the arguments upfront and pass them to the loader instead. This means changing the loader and the source code generator that uses it. We can add a vararg for now so that the code without specific arguments are the same.
@@ -49,6 +55,23 @@ | |||
*/ | |||
public class AotSpringBootConfigContextLoader extends SpringBootContextLoader { | |||
|
|||
// "SpringBootTestArgs#get(Set)" static method | |||
private static final Method SPRING_BOOT_TEST_ARGS__GET; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than using reflection, I'd rather add an accessor class in spring-native
the same way we do elsewhere (a class in the same package that exposes the package-private behavior).
Thanks @snicoll, I got a picture. |
Retrieve `args` parameter from `@SpringBootTest` at build time and pass it to the `AotSpringBootConfigContextLoader` for runtime use. Signed-off-by: Tadaya Tsuyukubo <tadaya@ttddyy.net>
@snicoll Should we include that in 0.11.2? If yes, can I let you merge it with potential refinement if needed? |
Thanks for the nudge. It looks good but considering we're going to release shortly, I've moved that one to the next release. |
Retrieve `args` parameter from `@SpringBootTest` at build time and pass it to the `AotSpringBootConfigContextLoader` for runtime use. See gh-1447
Thanks again @ttddyy |
Reflectively access
SpringBootTestArgs
(package private) to supportargs
param in@SpringBootTest
.