-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Document that test slices should not be combined #14981
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
To summarize the stackoverflow question, the following test: @RunWith(SpringRunner.class)
@JdbcTest
@JsonTest
public class MyTest {
@Test
public void test() {
System.out.println("Hello, World !");
}
} Fails with Spring Boot 2.1 due to:
|
The root cause is the change made for #14052 which means we now have two different bootstrap classes. |
I wonder if we can meta-annotate |
@philwebb if you don't mind I'd like to give this a shot. |
Your idea works, but not for
I wonder if multiple slices are supported at all officially. |
@dreis2211 Thinking about this some more, I'm of the opinion that it worked by luck last time and it isn't something we should officially support. It's going to add a lot of complexity if we let people compose these annotations. For example, how would be combine the new I'll switch this one to a documentation issue. |
@G-Lem I just posted an answer to the stackoverflow question https://stackoverflow.com/a/53033018/1526192 |
@philwebb For learning purposes I made a best effort implementation that seems to be working. If you're interested: master...dreis2211:gh-14981 This also already includes a change in the documentation, which I'm happy to isolate in a dedicated PR if necessary. Let me know what you think, |
@dreis2211 A pull request of that documentation change would be great, please. Perhaps reworded slightly to make it sounds more definite by removing "officially" and replacing "you can pick" with "pick"? |
@wilkinsona Give me a minute or two |
Wow, that was fast! Thank you, @dreis2211. Closing in favour of #15310. |
Could you have a look at this issue ?
https://stackoverflow.com/questions/52527394/in-spring-boot-2-1-many-test-slices-are-not-allowed-anymore-due-to-multiple-boo?noredirect=1#
The text was updated successfully, but these errors were encountered: