-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Boilerplate-less SpringJUnitConfig #32739
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
Comments
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug. |
@snicoll then let's treat this issue a bug Test
does not find any bean in package Test
finds all beans in the package. It does not make a sense, because empty |
@michaldo it doesn't work like that. You can't decide something is a bug without a reasonable explanation. The
A test is not a configuration class. |
I do not like ask on SO. First, SO is for concrete problems, not discussions. Second, it does not work: I asked https://stackoverflow.com/q/78383825/2365727 a week ago and no response
Intellij highlights |
I think that the following formula
is compact, compliant with Although super compact Anyway, compact version is acceptable and I'm fine to close this issue |
My Spring application has many beans, logically segregated in Java packages (f.e.
order
,product
, etc.). I would like to test each package in isolation. I would like to start all beans from the package as simple as possible.It seems that best choice is
@SpringJUnitConfig
. The annotation starts a context, but without help it does not know where to find beans. It is not easy to help the annotation.@Configuration
class, but again - I want context built like production context.Let's start from beginning. You are
@SpringJUnitConfig
. You have to start a context, but you have no any hint about beans. Where beans may located? Hmm, in current package?My solution: if I have package
com.company.order
with beans, I can write testI woild like
I could try to implement it myself, but I need a hint how to start
The text was updated successfully, but these errors were encountered: